How can i set the cursor focus on the top of the page when I clicked Update button. Update button is under UpdatePanel

thank...

link|flag
Your question isn't particularly clear. Can you define what you mean by 'top of the page' ? – Town 20 mins ago
You'll also need to post some code in your question - posting code helps people to understand your problem, which in turns helps you to get a solution. – Town 13 mins ago

1 Answer

i'm not clear with what you mean (top of the page) So, i assume you want to focus on text box.

To do this, Add this in your page_load()'s

   if(!IsPostBack)
    {
       btnUpdate.Attributes.Add
         ("onclick","document.getElementById('<%= txtName.ClientID %>').focus()");
    }

Hope it works! (not tested yet)

link|flag
You want "document.getElementById('" + txtName.ClientID + "').focus()" server-side. – Town 21 mins ago

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.