Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6097089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:00:10+00:00 2026-05-23T13:00:10+00:00

I want to set focus to an element (a button) after the user clicks

  • 0

I want to set focus to an element (a button) after the user clicks on Submit, but the focus is not on a new page it is in the same page. What is happening is that when they click submit i am evaluating a few conditions.. if one of them is met I send them back to the same page (or do not re-direct) in other terms but it still postsback so, when it postsback I again after the submit, i want to set the focus to this item.. how can i do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:00:10+00:00Added an answer on May 23, 2026 at 1:00 pm

    So you want to set the focus of the page to a WebControl on the page? i.e. a <asp:Button>?

    You can use ControlId.Focus()

    EDIT

    If you are talking about the Scroll position after postback, then you could try this

    <%@ Page MaintainScrollPositionOnPostback="true" %>
    

    Now I have never used it before or tried it, so not sure if it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want set Listbox background to transparent but not working Is there any idea?
I want to set focus on inputText field in JSF on page load. How
Am using Django's form for my login page. I want to set focus to
I want to set focus on the first form element in a div, either
I want to set focus on entry that is not visible in pyGTK for
Hi I want to set focus on <h:inputText> element whenever rich:panelBarItem is opened. I
It's fairly straightforward. I want to set focus to the first enabled and not
What I want to do is set the focus to a specific control (specifically
I want to set a breakpoint on the __DoPostBack method, but it's a pain
I want to set some attributes just before the object is serialized, but as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.