TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vishwakant Tripathi
1k
721
838.5k
How to set focus on a control in asp.net?
Aug 23 2016 9:33 AM
Hi,
I have one asp.net page, which has a Button (Submit button) that has PostBackUrl ="#" that helps to maintain scroll position during page post back.
I have set MaintainScrollPositionOnPostback="true" in Page directive on the page.
Submit button code behind is something like this ...
protected void SubmitButton_Click(object sender, EventArgs e)
{
try
{
txtName.Focus();
}
catch (Exception ex)
{
//error
}
}
Where txtName is a textbox on the page which I need to focus. (Not exactly focus to textbox only but some other logic that I have removed from here.)
So can someone please help me to get rid of this issue.
Thanks.
Vishwakant.
Reply
Answers (
8
)
Hide edit and delete button based on the status of each reco
how to open the URL on the body of the page