I am trying to focus in textbox after text in asp.net c# but I am unable to do it
my c# code is given below, please tell me where i am wrong:-
TextBox txtindex = (TextBox)RptTask.Items[Nextindex].FindControl("TxtDuration");
txtindex.Focus();
Apply Focus Method on Text in Page_PreRender
//pre-render code as given below,
protected void Page_PreRender(object sender, EventArgs e)
{
try
{
TextBox txtindex = (TextBox)RptTask.Items[Nextindex].FindControl("TxtDuration");
txtindex.Focus();
}
catch(Exception ee)
{
}
}
Hope It will Help!
defaultfocusattribute of theformitself toTxtDuration.