Question : How to make a dynamic Required field validator

Hello experts,
I wonder if it's possible to create a dynamic required field validator. The logic i'm after for is this...
IF Textbox1 is  null or ='' THEN TEXTBOX2 is required (i mean user needs to supply data) ELSE Textbox2 is not required.

Is this possible? Any code suggestion/s or links is much appreciated.

Answer : How to make a dynamic Required field validator

Hi jsuanque,
You can group it into different validation group instead of creating dynamic required field validator.
eg:
id="RequiredFieldValidator1"
      controltovalidate="NameTextBox"
      validationgroup="PersonalInfoGroup"
      errormessage="Enter your name."
      runat="Server">
    r>

   



          text="Enter your age:"
      runat="Server"
      AssociatedControlID="AgeTextbox">
   



       text="Enter your city of residence:"
      runat="Server"
       AssociatedControlID="CityTextbox">
   


     

          runat="Server">
   


     

    id="RequiredFieldValidator3"
      controltovalidate="CityTextBox"
      validationgroup="LocationInfoGroup"
      errormessage="Enter a city name."
      runat="Server">
    r>

Check this MSDN site for further details:
http://msdn.microsoft.com/en-us/library/ms227424.aspx
Random Solutions  
 
programming4us programming4us