How to access a user control from another user control in a Wizard control

My page has a wizard control and each step is a user control.  I could find the value of a control in step1 user control in the wizard page but not in step2 user control.

From wizard.aspx.vb – it worksDim m_title As DropDownList = CType(Me.PersonalBox1.FindControl("ddlTitle1"), DropDownList)

Question:How can I find the value of a control(textbox or dropdownlist)in step1 user control from step2 user control?


I want to find β€œPersonalBox1.FindControl("ddlTitle1")” from Step2 AddressBox1. I have tried several ways to access it but no luck.

 From AddressBox.ascx.vb – it didn’t work.Dim m_title As DropDownList =  CType(Me.Parent.Page.FindControl("wzd1$PersonalBox1$ddlTitle1"), DropDownList)

 <wizard.aspx.vb>    

<asp:Content ID="maincontent" ContentPlaceHolderID="maincontent" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" AllowCustomErrorsRedirect="false" EnablePartialRendering="true"  runat="server">
</asp:ScriptManager> 
<asp:UpdatePanel ID="UpdatePanel1" runat="server">   
 <ContentTemplate>      
     <div  class="contentleft">   
         <asp:Wizard ID="wzd1" runat="server" SkinID="wzd1"         ActiveStepIndex="0" >       
             <WizardSteps>           
                 <asp:WizardStep runat="server" title="Personal" ID="wspPersonal">               
                     <uc:PersonalBox ID="PersonalBox1" runat="server" />           
                     </asp:WizardStep>                      
                     <asp:WizardStep runat="server" title="Address" ID="wspAddress">               
                      <uc:AddressBox ID="AddressBox1" runat="server" />           
                      </asp:WizardStep>          
                      <asp:WizardStep ID="wspConfirmation" runat="server" Title="Confirmation" StepType="Finish"  >       
                      </asp:WizardStep>           
                 </WizardSteps>            
               <FinishNavigationTemplate>Removed all buttons from the Finish Navigation Template</FinishNavigationTemplate>            </asp:Wizard>
           </div>  
       </ContentTemplate> 
      
  </asp:UpdatePanel>
</asp:Content>

 

 

Thanks

 

Amy

0
amy88
8/11/2008 7:56:02 PM
πŸ“ asp.net.presentation-controls
πŸ“ƒ 72751 articles.
⭐ 3 followers.

πŸ’¬ 2 Replies
πŸ‘οΈβ€πŸ—¨οΈ 1945 Views

Can anyone shed some light on this? Thanks

0
amy88
8/11/2008 8:28:17 PM

Hi amy88,

Try this:

Dim pb As PersonalBox = DirectCast(wzd1.WizardSteps(0).FindControl("PersonalBox1"), PersonalBox)
Dim m_title As DropDownList = DirectCast(pb.FindControl("ddlTitle1"), DropDownList)

Thanks,


Qin Dian Tang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Qin
8/15/2008 7:35:56 AM
Reply: