Solved

Navigation Button MouseOver/MouseOut in ASP.NET Wizard Control

Posted on 2009-04-06
1
1,074 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 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