Solved

Navigation Button MouseOver/MouseOut in ASP.NET Wizard Control

Posted on 2009-04-06
1
1,065 Views
Last Modified: 2013-11-26
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
Comment
Question by:rschaeferhig
1 Comment
 

Accepted Solution

by:
rschaeferhig earned 0 total points
ID: 24078561
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now