Hi Naomi,
>
>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.
Wouldn't you have to put a method in your user control to do this? I am guessing as I am not too sure of your situation, but I doubt the FindControl would actually find a control within your user control.
Tim
Timothy Bryan