Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Server controls and JavaScript
Message
De
15/02/2005 09:47:33
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
 
 
À
15/02/2005 04:40:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00986187
Message ID:
00987000
Vues:
19
That worked! Thanks for your help.

Jim

>I tried this and worked.
>
>
>		private void Page_Load(object sender, System.EventArgs e)
>		{
>			Button1.Attributes.Add("onMouseOver",
>				"this.style.backgroundColor='red';");
>		}
>
>Unlike VB, both C# and JScript are case sensitive. I think it's 'backgroundcolor' in your code. Change it to backgroundColor and test.
>Cetin
>
>>When I use the code below in the load event of the webform, nothing happens when the mouse is over the button. The code I have is below.
>>
>>
>>*******Web Form Load Event Code ************
>>
>>Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
>>     'Put user code to initialize the page here
>>     Button2.Attributes.Add("OnMouseOver", "changecolor(this,'red');")
>>End Sub
>>
>>
>>******** Resulting HTML Code in runtime ***********
>>
>><input type="submit" name="Button2" value="Button" id="Button2" OnMouseOver="changecolor(this,'red');" style="Z-INDEX: 101; LEFT: 176px; POSITION: absolute; TOP: 136px" />
>>
>>
>>******** JavaScript Function in html code after the ******
>>
>><script language="javascript">
>>    function changecolor(oBtn, sColor)
>>      {
>>        oBtn.style.backgroundcolor = sColor;
>>      }
>></script>
>>
>>
>>
>>>Or you can do it while building the page on the server via
>>>myctl.attributes.add("onmouseover","javascript:dothis()");
Thanks

Jim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform