473,763 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FindControl on a Wizard

I customized the SideBarTemplate of the Wizard control and added a Label with ID Label1 to it.
I want to change the Text of the label based on the current step. But the following always returns null
Label L = (Label)Wizard1. FindControl( "Label1" );

As per the help file, this should return the Label.

Here is the script for the template

<SideBarTemplat e>

<asp:DataList ID="SideBarList " runat="server" Height="90px" Width="162px">

<SelectedItemSt yle Font-Bold="True" />

<ItemTemplate >

<asp:LinkButt on ID="SideBarButt on" runat="server"> </asp:LinkButton>

</ItemTemplate>

</asp:DataList><b r />

&nbsp;<asp:Butt on ID="Button1" runat="server" Text="Button" Visible="False" />

<br />

<asp:Label ID="Label1" runat="server" BackColor="Blac k" Font-Names="Tahoma" Font-Size="X-Small"

ForeColor="#FFF F80" Text="Label" Width="167px"></asp:Label>

</SideBarTemplate >

Any help appreciated.

Thanks in Advance

Mar 29 '07 #1
2 5925
Anyone ? I searched group and web. no use.
I have to switch to a Multiview if this does not work.

Thanks
"Srini" <ls******@hotma il.comwrote in message
news:u7******** ******@TK2MSFTN GP04.phx.gbl...
I customized the SideBarTemplate of the Wizard control and added a Label
with ID Label1 to it.
I want to change the Text of the label based on the current step. But the
following always returns null
Label L = (Label)Wizard1. FindControl( "Label1" );
As per the help file, this should return the Label.
Here is the script for the template
<SideBarTemplat e>
<asp:DataList ID="SideBarList " runat="server" Height="90px" Width="162px">
<SelectedItemSt yle Font-Bold="True" />
<ItemTemplate >
<asp:LinkButt on ID="SideBarButt on" runat="server"> </asp:LinkButton>
</ItemTemplate>
</asp:DataList><b r />
&nbsp;<asp:Butt on ID="Button1" runat="server" Text="Button" Visible="False"
/>
<br />
<asp:Label ID="Label1" runat="server" BackColor="Blac k" Font-Names="Tahoma"
Font-Size="X-Small"
ForeColor="#FFF F80" Text="Label" Width="167px"></asp:Label>
</SideBarTemplate >
Any help appreciated.
Thanks in Advance
Mar 30 '07 #2
Srini,

First you need to get access to the SideBarContaine r and the SideBarList.
Your Label will be in the SideBar datalist.

Control lst1 = (Control)wizRec ordAttendance.F indContro("Side BarContainer");
DataList lst = (DataList) lst1.FindContro l("SideBarList" );

foreach (DataListItem ctrl in lst.Items)
{
Label lbl = (Label ) ctrl.FindContro l("Label1");
}


"Srini" wrote:
I customized the SideBarTemplate of the Wizard control and added a Label with ID Label1 to it.
I want to change the Text of the label based on the current step. But the following always returns null
Label L = (Label)Wizard1. FindControl( "Label1" );

As per the help file, this should return the Label.

Here is the script for the template

<SideBarTemplat e>

<asp:DataList ID="SideBarList " runat="server" Height="90px" Width="162px">

<SelectedItemSt yle Font-Bold="True" />

<ItemTemplate >

<asp:LinkButt on ID="SideBarButt on" runat="server"> </asp:LinkButton>

</ItemTemplate>

</asp:DataList><b r />

<asp:Button ID="Button1" runat="server" Text="Button" Visible="False" />

<br />

<asp:Label ID="Label1" runat="server" BackColor="Blac k" Font-Names="Tahoma" Font-Size="X-Small"

ForeColor="#FFF F80" Text="Label" Width="167px"></asp:Label>

</SideBarTemplate >

Any help appreciated.

Thanks in Advance
Apr 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4071
by: chrisn | last post by:
Hi, (Using ASP.Net 2.0) I have a wizard control inside a detailsview control. When I attempt to call the InsertItem method on the DetailsView I get an error "ObjectDataSource 'ObjectDataSource1' has no values to insert. Check that the 'values' dictionary contains values." I have found I can suppress the error by placing a hidden field inside
1
229
by: Hugo Mind | last post by:
Hi, I've used a Wizard and have added a Gridview in STEP 1, but I'm unable to access it. mygrid always returns null :( ? Any ideas ? protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
0
2688
by: Terry | last post by:
Developing Environment: Visual Studio 2.0 ASP.NET Question: I have a gridview control inside of a wizard control. I'm having issues accessing the SelectedDataKey.Values("ID AS STRING") of the grid control. I can access the DataKeyNames and other properties but the SelectedDataKey.Values are nothing (null). Once I move the Gridview out of the wizard control, I can access the SelectedDataKey value. Any Ideas? I have used the following code...
1
3068
by: JJ | last post by:
I have two related problems: (a). trying to set the default button within a CreateUserWizard control ----------------------------------------------------------------- I've done this in a messy way (see below) and wonder if anyone know how I could have done it using nested FindControl's and ClientID/UniqueID (I tried jst about every combination!) The button names you see in the code were obtained by viewing the source of the html...
1
5842
by: JTok | last post by:
I have an asp.net website I am designing using VS2005 standard. It is installed on Win2K3 Enterprise. In a Wizard Control, I want to take user input from two textboxes, add them together, and then display the results in a label when the user clicks a button. I am using VB. Here is an example of what I'm trying to do: <%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
2
1270
by: Mike | last post by:
I'm helping out on a web app and the developer that created the aspx pages is using <asp:wizardon the form. There are dropdowns, labels, buttons, etc within each wizard. How can I find a button in one of these wizards? I'm using something like Button btn = (Button)Wizard.WizardStep.FindControl("button1"); btn.visible = false; but I keep getting the error: 'Error: Object reference not set to an instance of an object'
1
1231
by: Mike | last post by:
I have a web form that I took over from a developer and he put everything inside a Wizard control. I now need to find a button in the wizard control to hide it. I've done button btn = wizard1.wizardstep.findcontrol("button); btn.Visible = false; and i get an error, I've tried several other combinations and none of them work, So I can I hide a button that is in a 'wizard'?
0
1147
by: Mike | last post by:
I have a web page that is using the asp.net wizard control. On this wizard, there is a next, cancel buttons, how can I find these buttons in this wizard. If I do something like this TemplatedWizardStep tws = (TemplatedWizardStep)Wizard1.WizardSteps; Button btn = (Button)tws.CustomNavigationTemplateContainer.FindControl("Button6"); btn.visible = false; - button6 is the name of the button I want to hide. I keep getting:
8
10838
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList = (DataList)myContainer.FindControl("SideBarList");
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.