PC Review


Reply
Thread Tools Rate Thread

Could'nt Find MouseHover Event

 
 
=?Utf-8?B?U2F1cmFiaA==?=
Guest
Posts: n/a
 
      23rd Aug 2006
I'm a user of Visual Studio Web Developer 2005 Express Edition & I use C# as
the language in it. So, the problem i'm facing is that I want to add a
MouseHover event to an image but i could'nt find it in the Events' list in
Properties window as in Microsoft Visual C# 2005 Express Edition.Can you tell
me where it lies or isthere any other way to do it in Web Developer. I'll be
thankful if you solve my problem.

Saurabh


 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      23rd Aug 2006
Hi Saurabh,

In the Web page, the mouseover event is a client event, so you won't find it
in C# server-side events. However, you can add the JavaScript code in
ASP.NET.

See the code sample below that demonstrates the technique.

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

protected void Page_Load
(object sender, EventArgs e)
{
ImageButton1.Attributes.Add("onmouseover",
"this.src='http://www.gc.ca/images/francaisbt.gif'");
ImageButton1.Attributes.Add("onmouseout",
"this.src='http://www.gc.ca/images/englishbt.gif'");
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>MouseOver MouseOut Image</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:imagebutton id="ImageButton1" runat="server"
imageurl="http://www.gc.ca/images/englishbt.gif" /></div>
</form>
</body>
</html>


"Saurabh" <(E-Mail Removed)> wrote in message
news:678DCE81-E109-408C-BA72-(E-Mail Removed)...
> I'm a user of Visual Studio Web Developer 2005 Express Edition & I use C#
> as
> the language in it. So, the problem i'm facing is that I want to add a
> MouseHover event to an image but i could'nt find it in the Events' list in
> Properties window as in Microsoft Visual C# 2005 Express Edition.Can you
> tell
> me where it lies or isthere any other way to do it in Web Developer. I'll
> be
> thankful if you solve my problem.
>
> Saurabh
>
>



 
Reply With Quote
 
=?Utf-8?B?U2F1cmFiaA==?=
Guest
Posts: n/a
 
      23rd Aug 2006
Hi Ken,
Thanks, it did work & this much programing I can do to modify it
according to my requirements. But i still want to know if it is possible
using C# in Web Developer.
 
Reply With Quote
 
=?Utf-8?B?U2F1cmFiaA==?=
Guest
Posts: n/a
 
      23rd Aug 2006
Hi Ken,
I have another question. How can I change the picture of
onmouseover & onmouseout event. I mean can I import the picture file for my
website. It properly shows the picture which is on the internet but not the
one which is on my pc when i debug the web application.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i increase the mousehover event timer? Marc Microsoft VB .NET 12 2nd Mar 2007 06:21 PM
TabControl MouseHover Event : Help... Deep Silent Ocean Microsoft Dot NET Framework Forms 1 28th Sep 2005 08:08 PM
Re: MouseHover or MouseEnter event show tag? Nicholas Paldino [.NET/C# MVP] Microsoft C# .NET 0 7th Mar 2005 09:17 PM
Slow MouseHover event Natan Microsoft C# .NET 1 25th Feb 2004 01:17 PM
Re: how do you get the coordinates associated with a mouseHover event? K. Shier Microsoft Dot NET Framework Forms 0 12th Aug 2003 09:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:07 AM.