|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Defauly focus in a WizardStepHi;
How can I set the control to get the focus in a WizardStep? Everything I can find shows how to do this for a form but in a wizard each step has a different default control. -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars - http://www.windwardreports.com/film.htm Hello Dave,
As for the focus in web page, the whole page wil only have a single focus. So if you put wizard control on the page, those child controls in wizardsteps also share this page focus. If you want to make a certain sub control in your wizard control(in a certain wizardstep) get focus. You can consider use Wizard control's Prerender event to get the control's reference and then call Page.SetFocus against it. e.g. ==========aspx template============== <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Height="135px" Width="602px" OnPreRender="Wizard1_PreRender1"> <WizardSteps> <asp:WizardStep runat="server" Title="Step 1"> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> </asp:WizardStep> <asp:WizardStep runat="server" Title="Step 2" OnPreRender="Wizard1_PreRender"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" /> <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton> <asp:ImageButton ID="ImageButton1" runat="server" /> <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem>aaa</asp:ListItem> <asp:ListItem>bbb</asp:ListItem> <asp:ListItem>ccc</asp:ListItem> </asp:DropDownList> </asp:WizardStep> <asp:WizardStep runat="server" StepType="Finish" Title="Step 3"> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> </asp:WizardStep> </WizardSteps> </asp:Wizard> ============code behind========== protected void Wizard1_PreRender1(object sender, EventArgs e) { if (Wizard1.ActiveStepIndex == 1) { Control control = Wizard1.WizardSteps[1].FindControl("DropDownList1"); Page.SetFocus(control); } } ================== Hope this helps. Sincerely, Steven Cheng Microsoft MSDN Online Support Lead ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
access validation info in client script
Loading JavaScript files from a class library Image button and tabstop=false set dropdownlist selectedindex in datagrid System.Windows.Forms.WebBrowser and Java and Blank Pages Cause GridView to be sorted from DropDownList CreateUserWizard Stepping Problem GridView Dynamically Inserted Template with RadioButton ASP.NET book AJAX Animation |
|||||||||||||||||||||||