DOTNET(validation)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smithak82
    New Member
    • Sep 2008
    • 12

    DOTNET(validation)

    How to put validation on dynamic dropdownlist.
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    Originally posted by smithak82
    How to put validation on dynamic dropdownlist.
    You will have to loop through all the controls in your form or page

    for eg:
    Code:
    foreach (Control mycontrol in this.Controls)
                {
                    if (mycontrol.Name == ("textBox1"))
                    {
                        TextBox t = (TextBox)mycontrol;
    
                        if (t.Text.Length > 10)
                        {
                            MessageBox.Show("Hi");
                        }
                    }
                }
    you could store the names in List<string>.. and generate control at runtime...

    Comment

    • kenobewan
      Recognized Expert Specialist
      • Dec 2006
      • 4871

      #3
      An easier way, .net, is to add a 'please select'. If that is the value returned, exit function and make a label visible. Otherwise dhtml...

      Comment

      Working...