G
Guest
I've used C# to register a javascript function in the PageLoad event of a web
form page. My problem is that I can't seem to figure out how to call it.
I've tried the following, all to no avail:
<a href="javascript: myscript()">click here</a>
<asp:hyperlink id="hplnk1" runat="server" target="javascript:
myscript()">click here</asp:hyperlink>
<asp:linkbutton id="lnkbtn1" runat="server" onclick="javascript:
myscript()">click here</asp:linkbutton>
here's the function (simplified for the sake of saving space):
<script language='javascript'>
function myscript()
{
alert('You have clicked the link')
}
</script>
Can anyone please show me what I'm doing wrong? Thanks
form page. My problem is that I can't seem to figure out how to call it.
I've tried the following, all to no avail:
<a href="javascript: myscript()">click here</a>
<asp:hyperlink id="hplnk1" runat="server" target="javascript:
myscript()">click here</asp:hyperlink>
<asp:linkbutton id="lnkbtn1" runat="server" onclick="javascript:
myscript()">click here</asp:linkbutton>
here's the function (simplified for the sake of saving space):
<script language='javascript'>
function myscript()
{
alert('You have clicked the link')
}
</script>
Can anyone please show me what I'm doing wrong? Thanks