473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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

<SideBarTemplate>

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

<SelectedItemStyle Font-Bold="True" />

<ItemTemplate>

<asp:LinkButton ID="SideBarButton" runat="server"></asp:LinkButton>

</ItemTemplate>

</asp:DataList><br />

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

<br />

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

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

</SideBarTemplate>

Any help appreciated.

Thanks in Advance

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

Thanks
"Srini" <ls******@hotmail.comwrote in message
news:u7**************@TK2MSFTNGP04.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
<SideBarTemplate>
<asp:DataList ID="SideBarList" runat="server" Height="90px" Width="162px">
<SelectedItemStyle Font-Bold="True" />
<ItemTemplate>
<asp:LinkButton ID="SideBarButton" runat="server"></asp:LinkButton>
</ItemTemplate>
</asp:DataList><br />
&nbsp;<asp:Button ID="Button1" runat="server" Text="Button" Visible="False"
/>
<br />
<asp:Label ID="Label1" runat="server" BackColor="Black" Font-Names="Tahoma"
Font-Size="X-Small"
ForeColor="#FFFF80" 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 SideBarContainer and the SideBarList.
Your Label will be in the SideBar datalist.

Control lst1 = (Control)wizRecordAttendance.FindContro("SideBarCo ntainer");
DataList lst = (DataList) lst1.FindControl("SideBarList");

foreach (DataListItem ctrl in lst.Items)
{
Label lbl = (Label ) ctrl.FindControl("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

<SideBarTemplate>

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

<SelectedItemStyle Font-Bold="True" />

<ItemTemplate>

<asp:LinkButton ID="SideBarButton" runat="server"></asp:LinkButton>

</ItemTemplate>

</asp:DataList><br />

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

<br />

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

ForeColor="#FFFF80" 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
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...
1
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...
0
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...
1
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...
1
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...
2
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...
1
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 =...
0
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...
8
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.