Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting focus to the control on the page (AJAX site)
Message
From
26/02/2008 09:54:53
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01294462
Message ID:
01296415
Views:
21
>>>Sounds like it should be a very common task...
>>
>>I thought I had seen this posted, but you can find all the controls like this
>>Dim c As Control
>>For Each c In Me.Controls
>>if(TypeOf c Is TextBox) Then
>>c.Text = ""
>>End If
>>Next c
>>
>>
>>Sorry my VB is a bit rusty but that should do it. I suspect you will have to test for each type of control you have.
>>Tim
>
>Yes, looks like it if I want to loop through all controls. I thought Clear was a common method, but apparently each control has its own way of clearing content.
>
>BTW, I updated my original reply with great link I found (found few more as well):
>
>http://www.codersource.net/asp_net_simple_tips.html
>
>http://forums.asp.net/t/1088137.aspx
>
>http://www.odetocode.com/Code/71.aspx
>
>I'll try tomorrow both ways (Response.Redirect (or Server.Transfer) vs. iterating through form controls.
>
>BTW, we're using C# here.
Oh, good then we speak the same. :-)
Tim
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform