0

Now i have two buttons that contain attributes "ValidationGroup='Group1'".And there will only one button can be displayed when page load(based on some conditions).the problem is the onclick event can't be fired for the hidden button's validation. So how can i disable the validation group of the hidden buttons in backstage?

Tangfb
  • 183
  • 8

2 Answers2

1

My tip would be to use two separate validation groups, one for each button and then just disable the correct group by ValidationGroup1.Enabled = false;

Magnetize
  • 364
  • 1
  • 9
  • 17
0

You can use CauseValidation proppery to overcome this issue as follows on your hidden button

 CausesValidation="False"
शेखर
  • 17,412
  • 13
  • 61
  • 117
  • when i code in backstage like this: `if(btn.visible==false){ btn.attributes.Add("CausesValidation","false"); }` but it doesn't work,the other button's click event can't be fired. – Tangfb Oct 23 '13 at 05:10
  • it's not like that it should be like `btn.CausesValidation=false` – शेखर Oct 23 '13 at 08:22