Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing first control of the FormView
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Accessing first control of the FormView
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01325311
Message ID:
01325311
Views:
85
Hi everybody,

I have a FormView with UserControls inside. I want to be able to set focus to the FirstControl in the FormView (BTW, this control in the ReadOnly mode).

I tried
TextBox txt = currentForm.Row.FindControl("txtFirstName") as TextBox;
            if (txt != null)
                txt.Focus();
            else
                currentForm.Row.Focus();
txtFirstName is a first control in the General User Info user control.

I only got the else part executed.

Any ideas how can I set focus to the first control?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform