Click here to Skip to main content
15,922,894 members

Comments by abhishekdhanotia (Top 1 by date)

abhishekdhanotia 27-Aug-12 5:47am View    
Best solution for this:
1) Create a user control, contains two elements
a) Email Address (Should be in separeate Div)
b) Numeric Field (Should be in separeate Div)

2) Apply dotnet Required Field Validators on each control.
3) Create two public properties in user control:
a) isEmailVisible
b) isNumericFieldVisible

3) Call this user control whereever you required in your application. In case if you dont required any Element then make public property to false.

4) On Page_Load of User Control, On the basis of public property make field hide / visible, same disable / Enable RequiredFieldValidators.