Click here to Skip to main content
15,917,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hallo everyone,

I have got a situation on which I get stacked. Here is what I faced, there are fields which are grouped into two validation scenarios. I used customvalidator control for the situation I have, along with radio buttons are used to give the user alternation between. Either of the two field groups have to be filled out at a time. This works fine until the page is posted back (gone to server). When the page get returned, however, it wouldn't work properly. Both the radio buttons loose their states and everything become available (active), so that it will be possible to fill both field groups which is not wanted. The radio buttons are html controls, and the customvalidator is an asp.net control. I used javascript and jquery for this operation to be met.

The fields and the radio buttons are in updatepanel control, also.

Please let me know, if there is any confusion.

Many thanks,
Posted

1 solution

Html control could not maintain state. So could do like this..
1) When page is postback, store the radio button in hidden field then show the selected radion button against hidden field
2) Have u tried to make html radio buttons runat="server"
 
Share this answer
 
Comments
Yonathan1111 31-May-11 7:59am    
Ok, I will experiment the first one and nope for the second one(I didn't try runat="server").

Thanks for your quick answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900