Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
151 Points
67 Posts
Jul 20, 2011 06:16 PM|LINK
Hi,
Please try this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="TestApplication.WebForm3" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function hello() { alert('Hi, good morning!'); } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="lblMsg" onclick="javascript:hello();" Text="Click Here" Font-Bold="true" runat="server"></asp:Label> </div> </form> </body> </html>
vikas-anand
Member
151 Points
67 Posts
Re: Call javascript function on Label click
Jul 20, 2011 06:16 PM|LINK
Hi,
Please try this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="TestApplication.WebForm3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function hello() {
alert('Hi, good morning!');
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblMsg" onclick="javascript:hello();" Text="Click Here" Font-Bold="true" runat="server"></asp:Label>
</div>
</form>
</body>
</html>