Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1118
  • Last Modified:

Navigation Button MouseOver/MouseOut in ASP.NET Wizard Control

I implemented a Wizard control and I'm trying to set the ImageButton attributes for OnMouseOver and OnMouseOut in Page_Load as I've seen for other implementations of ImageButton in Page_Load:

StartNextButton.Attributes.Add("OnMouseOver","~/images/NextOn.jpg")

But "StartNextButton" doesn't show up in the Intellisense in the code-behind for Default.aspx. The HTML for the upper section of the Wizard (it's big) is included. Can anyone tell me how to find the button so I can add attributes?
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" BackColor="#F7F6F3"
BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana"
Font-Size="0.8em" DisplaySideBar="False" HeaderText="Test Your Risk IQ" NavigationStyle-HorizontalAlign="Left">
<StepStyle BorderWidth="0px" ForeColor="#5D7B9D" />
<StartNavigationTemplate>
    <asp:ImageButton ID="StartNextButton" runat="server" CommandName="MoveNext" ImageUrl="~/Images/step_next.gif"   />
</StartNavigationTemplate>
<WizardSteps>
<asp:WizardStep runat="server" StepType="Start" Title="Question 1">

Open in new window

0
rschaeferhig
Asked:
rschaeferhig
1 Solution
 
rschaeferhigAuthor Commented:
I found some code on ASP.NET re adding Javascript to a button in a Wizard that I was able to adapt:
 

Dim StartNextButton As ImageButton = Wizard1.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton")
 
StartNextButton.Attributes.Add("onmouseover", "this.src='/Images/step_next_on.gif'")
 
StartNextButton.Attributes.Add("onmouseout", "this.src='/Images/step_next.gif'")
 
Dim StepNextButton As ImageButton = Wizard1.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton")
 
StepNextButton.Attributes.Add("onmouseover", "this.src='/Images/step_next_on.gif'")
 
StepNextButton.Attributes.Add("onmouseout", "this.src='/Images/step_next.gif'")
 
Dim StepPreviousButton As ImageButton = Wizard1.FindControl("StepNavigationTemplateContainerID").FindControl("StepPreviousButton")
 
StepPreviousButton.Attributes.Add("onmouseover", "this.src='/Images/step_previous_on.gif'")
 
StepPreviousButton.Attributes.Add("onmouseout", "this.src='/Images/step_previous.gif'")
 
Dim FinishPreviousButton As ImageButton = Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishPreviousButton")
 
FinishPreviousButton.Attributes.Add("onmouseover", "this.src='/Images/step_previous_on.gif'")
 
FinishPreviousButton.Attributes.Add("onmouseout", "this.src='/Images/step_previous.gif'")
 
Dim FinishButton As ImageButton = Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishButton")
 
FinishButton.Attributes.Add("onmouseover", "this.src='/Images/Bttn_total_score_on.gif'")
 
FinishButton.Attributes.Add("onmouseout", "this.src='/Images/Bttn_total_score.gif'")

Open in new window

0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now