G
Guest
I used to clear my page's control in Visual Studio 2003 using code like this:
Dim c As Control
For Each c In Page.Controls(1).Controls
If TypeOf c Is TextBox Then
CType(c, TextBox).Text = Nothing
End If
If TypeOf c Is DropDownList Then
CType(c, DropDownList).SelectedIndex = 0
End If
Next
It worked properly. Now I am using Visual Studio 2005 beta 1 version and I
am using Master Page for my forms. I used the same code but nothing happens
... clearing controls did not work ... seems they change the page's control
hierarchy when using master pages but I don't exactly know. Does anyone know
how can I fix the above code to make it work in my VS 2005 application?
Dim c As Control
For Each c In Page.Controls(1).Controls
If TypeOf c Is TextBox Then
CType(c, TextBox).Text = Nothing
End If
If TypeOf c Is DropDownList Then
CType(c, DropDownList).SelectedIndex = 0
End If
Next
It worked properly. Now I am using Visual Studio 2005 beta 1 version and I
am using Master Page for my forms. I used the same code but nothing happens
... clearing controls did not work ... seems they change the page's control
hierarchy when using master pages but I don't exactly know. Does anyone know
how can I fix the above code to make it work in my VS 2005 application?