Click here to Skip to main content
15,915,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all ,

I have a menu item and i want to change its source when mouse out and mouse over.Knowing that the image source is from global resource.I have set the images in correct ways in the global resource , but it is not working.Here is what i am doing

<img runat="server" alt="About Us" border="0" src="<%$ Resources:GlobalText, AboutUs%>"
onmouseover='this.src= <%$ Resources:GlobalText, AboutUsHover%>' onmouseout="this.src=<%$ Resources:GlobalText, AboutUs%>" />


And this is what generated when i debug javascript :

XML
<img src="images/AboutUs.jpg" border="0" onmouseover="this.src='&lt;%$ Resources:GlobalText, AboutUsHover%>'" onmouseout="this.src=&lt;%$ Resources:GlobalText, AboutUs%>" />


and the error is Invalid property value.

Please help .
Posted
Updated 28-Jul-11 3:05am
v2

You're trying to use javascript events to run asp.net code-behind. You can't do that. Try writing some javascript code to do it.
 
Share this answer
 
v2
Comments
mhamad zarif 28-Jul-11 9:42am    
please can you tell me from where to start in writing the javascript code
You are using wrong syntax.....

Plz try This.... may be will help u


XML
<img runat="server" alt="About Us" border="0" src="<%$ Resources:GlobalText, AboutUs%>"
onmouseover="this.src= '<%$ Resources:GlobalText, AboutUsHover%>';"
onmouseout="this.src='<%$ Resources:GlobalText, AboutUs%>';" />


Thanks
 
Share this answer
 
v2
Comments
mhamad zarif 28-Jul-11 9:03am    
Thanks for your help but it is not working .Please help me,i have to finish the website today.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900