In default.aspx I have:
<form id="form1" runat="server">
<div>
<asp:Button ID="clikme" runat="server" Text="click me" />
</div>
</form>
In default.aspx I have:
clikme.Attributes.Add("OnClick", "javaScript: return myfunction();");
And in JScript1.js I have
function myFunction() {
alert('this is my function');
return false;
}
The above code does not work it shows 'Microsoft JScript runtime error: Object expected'. I can't figure out how to find a solution.