Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to set focus to a textbox in a C# Wizard step inside an UpdatePanel

Posted on 2009-04-15
3
Medium Priority
?
1,117 Views
Last Modified: 2013-12-17
Tried many methods to place the cursor in a textbox in Wizard steps in a VS 2005 Wizard control. The control is inside an UpdatePanel. I can use a FindControl to identify the control successfully but the focus always defaults to the Step's Next button. My most recent code attempt is below. Suggestions?
//Called from an OnPreRender = "Wizard1_PreRender" statement in asp:Wizard
 
protected void Wizard1_PreRender(object sender, EventArgs e)
    {
        if (Wizard1.ActiveStep.Name == "Step 2")
        {
            TextBox textbox = (TextBox)Wizard1.FindControl("txtUserFirstName");
            Page.SetFocus(textbox);
        }
    }

Open in new window

0
Comment
Question by:Xignal76
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 1000 total points
ID: 24157533
Did you try textbox.Focus()?
0
 

Author Comment

by:Xignal76
ID: 24157700
Had, but did it again just to be sure. Same result - the Next button got focus.
0
 

Accepted Solution

by:
Xignal76 earned 0 total points
ID: 24159575
Figured out a workaround.

It works if you do not put the Wizard inside a single UpdatePanel, but instead place an UpdatePanel inside each WizardStep. The focus then gets set correctly.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question