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)


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






8/11/2008 7:56:02 PM 72751 articles. 3 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 7
Get it on Google Play
Get it on Apple App Store

Can anyone shed some light on this? Thanks

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)


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.
8/15/2008 7:35:56 AM

Similar Artilces:

Unable to access user control's user control's function\property from another user control
Hi, I used to call an user control's user control function as stated below from my user control in ASP.Net 1.1 wucCompany.wucEmployee.GetEmployeeSomething() After migrating to ASP.Net 2.0, I am unable to use any properties/functions(even the public ones) of the user control's User control's from another user control.  The way I have to do is create property\function in wucCompany which calls the wucEmployee's property\function and call the wucDepartment.GetEmployeeSomething().Since I need to do this change in too many places, I can...

Access User Control From another User Control
 ASP.NET 2.0/VB.NET I have a number of pages all with two user controls on them.  I need to access controls/properties from one user control from within another.  I've tried the following from one of the user controls: Dim pg as Page = cType(Me.Page, Page) pg.FindControl("myControl")  'Returns nothing pg.form.findControl("myControl")  'Returns nothing   I also have public properties declared but I can't see those either (I also tried public shared property).  Can anyone help with the syntax?   thanks, Scott ...

Updating a Label control in one user control from another user control
Hi all, I have a main page in my music store site that has 5 user controls on it with 1 always showing main content and the others being things like a shopping cart, "best sellers", genre list etc (a la amazon). From the main content control I want to be able to set some label controls in my shopping basket control but I just can't seem to work out the syntax for how to do this: Here's the code I'm using - I'm trying to go to the 4th user control on the page (my shopping basket) then find the appropraite label, cast it locally as a Label then update the value: Label _so...

access controls on web user control x from web user control Y
I have 2 web users controls in a page and I would like to get or set the selected values of a few dropdown boxes on web user control X from web user control Y and I also would like to know how to access functions that are on a web user control X from a web user control Y, is this possible? How can I do it? User can access and set the values of the User Control from .aspx page through properties,using javascript and in code-behind of aspx page.The details of it are shown below Using PropertiesIf the Sample.ascx control has two textboxes and submit button.You can access the valu...

User Controls in User Controls?
I have the follow set up and it is throwing an error "Unhandled error loading module" ... is there some trick to this that I don't know?I have a project A that uses controls from project B (project B is just a project with all my user controls used through out other modules).  project A uses user control 1 from project B with out any issues at all - great.  But then I wanted to add user control 2 to user control 1 and that is when I get my error.  In fact I don't even have the user control 2 in user control 1, just when I put the register part into user control 1 is when it al...

How to access one user control from another user control on same page
hi,I have two usercontrol on same page. 1.ascx and 2.ascx on abc.aspx . Now I need to access dropdown on 1.ascx frm 2.ascx . Plz help me how can i do this?I have tried Page.findcontrol but as a user control inherits usercontrol class and not page class . its not giving reference to proeprty Page.Findcontrol. I can do page.findcontrol on aspx page but I need to do it on ascx only.plz helpregards,max   Hi Max, you have to expose your DropDownList as a public property which lays inside usercontrol 1. Example: 1 class MyUserControl1 : UserControl 2 { 3 4 p...

User Control in a User Control
I have a first user control that contain a second user control. If I cahe the first user control can I still dynamically control the second one or it is cached with the first one therefore can not control it anymore? Thanks When your first control is cached, its rendered out and its output is stored in the cache. On every request to the page containing your control that can satisfy it from cache, the output will just simply be inserted - your first control will never be instantiated or run in that case, so the second one wont be either. Hope this helps,Mike VolodarskyProgram Manager...

user control to user control
I have an aspx page that have a "Register" directive to two usercontrol called rptMaster.ascx and rptDetail.ascx. I'm trying to set up a Master-Detail relationship and wish for the rptMaster.ascx to trigger and event from a dropdownlist and for the rptDetail to be listening for DropDownList event. I believe I have gotten the events part okay with help from this articel but my declaration for a private statement to my rptMaster class is producing an error. I'm using beta 2 of and I 'm having trouble getting a reference TO ...

User control in a user control
Hello all, I have created a user control with some checkboxes, and public properties to get the values of these checkboxes. I have also created a second user control using the first user control; this second control also access the public properties of the first one. My problem is when I implement the second control in an aspx page, if I click at runtime the checkboxes in the first control, I am able to access its public properties from the methods of the second control but the values of these properties are wrong. while at design time, I do not have this problem. Than...

How to access page control (editor control) from user control?
Hi, I want to do something, but I don't know if it's even possible. I'm trying to make a simple application to edit my website. I have a page called editPage.aspx which contains an editor control. (cuteEditor from cutesoft) I also have a Treeview that dynamically populates my website structure. I placed this treeview in a custom control (populateTreeView.ascx) and placed it on the editPage.aspx page. When you click on a html file in the treeview (inside the custom control) I check if the file exists. If it does exists I send it to a class which retrieves the editable region within this ...

User Controls not working if I put Validation controls in user control
Hi           I have validation controls(RequiredField Validator,RegularExpressionValidator)  in user controls.User controls are not posting back like the events are not wiring up.If I remove Validation controls in User controls page,user controls are working fine.Can anyone please help me out in getting it fixed. In the Validation controls, make sure you are setting the ControlToValidate property to the control that it links to.  If you're in .NET 2.0, it's also a good idea to put all the validation controls in the same Valid...

User Control controls not created when dynamically creating user control
  Have created a user control for displaying and editing a dynamically number of values. The user control contains two labels and an edit box. When dynamically loading the user control I get an error when the control itself tries to change setting on the fields within the user control.   Why doesnt this work? It works okay if I dont load it dynamically but create a user-control-instance in the aspx-page but thats no solution.   Thankyou!     Here is my code:   ucDataValue.ascx   <%@ Control Language="C#" AutoEventWireup="true&...

User Control Within UserControl
If I have a user control A and then inside it a user control B embedded/referenced within it.  User Control A has a panel defined (cpeNewUser) that I want to manipulate from the code behind of User Control B based on some event that happens.So putting this in my code behind of User Control B won't work as it has no idea of cpeNewUser:cpeNewUser.Collapsed = true;So is it because only at runtime they are married up and because of this you cannot access each other's objects at compile time?  How would I get this to work becuase I'm using all user controls inside a AJAX Too...

Reading a user control from another user control
I have 2 user controls on a page. The first one (UserControl1) is called "header.ascx". This contains a drop down list box called "ddlLang". The other user control (UserControl2) is called "menu.ascx". I want this user control to check the value of "ddlLang" in the header user control. How do I do it? Quite stuck at the moment! Thanks hi, even i am stuck to the same problem. what i came to know is 1) You have to find the page of control....(or if u want to hardcore it say its menuholder.aspx) 2) then u can use menuholder.use...

Web resources about - How to access a user control from another user control in a Wizard control -

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Venezuela's Opposition Wins Control of Legislature - Al Jazeera America
... celebrate the closing of a polling station during legislative elections in Caracas, Venezuela, Dec. 6, 2015. The opposition won control of the ...

The ACLU backs using the terror watch list for gun control, but only “with major reform”
... did say, through a spokesperson, that the watch list would need “major reforms” in order to be used as an effective tool for gun control and ...

With gun control off-limits, politicians want tech sector to fight terror
... very next day, the Senate voted against a measure that would have barred gun sales to people on federal terror watchlists. Another gun-control ...

Obama calls for better gun control, and for tech companies to help fight terrorism
President Barack Obama all but called out encryption in a 15-minute Address to the Nation speech on Sunday night. The President touched on various ...

Obama speaks on ISIS, gun control, tolerance in Oval Office address - Videos - CBS News
In a primetime speech Sunday night, President Obama said the terror attack in San Bernardino, California, shows terrorism is now in a new phase. ...

Porsche To Mission E Control: We Are Clear For Launch!
... handling of a Porsche. The contrast seemed to start early cries of the Mission E being the next Tesla [&hellip Porsche To Mission E Control: ...

Windows 10 vs. OS X: Which gives sys admins more control?
Nearly everything can be managed as if it were a mobile device, using APIs at the operating system for assured reach and consistent implementation ...

CNN's Smerconish Brings On GOP Ratf*er Karl Rove To Opine Over Partisan Divide On Gun Control
... was time to pray. The New York Daily News ran a controversial cover noting that God wouldn't fix this. Democrats again made calls for gun control. ...

Attorney General Says Obama Could Call For Congressional Action For More Gun Control
Attorney General Says Obama Could Call For Congressional Action For More Gun Control

Resources last updated: 12/8/2015 11:33:08 AM