How to reference the button in StartNavigationTemplate of WizardControl

M

M. Ali Qureshi

Hi,

I have a button in StartNavigationTemplate of a Wizard. The wizard itself is
placed in a View of MultiView.

I want to change the text of this button dynamically on Page_Load or
Wizard_Load.

How can i do that?

Here is what i have been trying:

<asp:MultiView ID="WizView" runat="server">
<asp:View ID="WeightView" runat="server">
<asp:panel ID="Panel1" runat="server"
CssClass="RaterHeading">Heading here...</asp:panel>
' There is another wizard here.
</asp:View>
<asp:View ID="HitRaterView" runat="server">
<asp:panel ID="RaterHeading" runat="server"
CssClass="RaterHeading">Heading here...</asp:panel>
<asp:Wizard ID="HitRaterWiz" runat="server">
<StartNavigationTemplate>
<asp:Button ID="HitRaterStartBackButton" runat="server"
Text="Tilbag til vægtning" CssClass="button"
onclick="HitRaterStartBackButton_Click" /> &nbsp;
<asp:Button ID="HitRaterStartNextButton" runat="server"
Text="Næste" CssClass="button" onclick="HitRaterGoForward"
ValidationGroup="HitValidator" />
</StartNavigationTemplate>
</asp:Wizard>
<div style="float:right;">
<asp:Label ID="HitRaterBackResult" runat="server"
CssClass="ErrorMessage" EnableViewState="false"></asp:Label>
</div>
</asp:View>
</asp:MultiView>

I am trying to change the button text on Wizard_Load as following:

Protected Sub HitRaterWiz_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles HitRaterWiz.Load
Dim SButton As Button =
HitRaterWiz.FindControl("HitRaterStartBackButton")
SButton.Text = "Changed"
End Sub

But it gives me the following error:

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.


Any help will be appriciated... thanks

/MAQ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top