Hi,
Set an event handler to the
OnClientClick
event on the button:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function call() {
alert("Call Client");
return true;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="btnclick" name="btnclick" type="button" runat="server" onserverclick="btnclick_ServerClick" OnClientClick="return call()" value="Input Button"/><br />
<asp:Button ID="btnClickAsp" runat="server" Text="ASP Button" OnClick="btnclick_ServerClick" OnClientClick="return call()"/>
</div>
</form>
</body>
</html>
If you do that, you don't need to set the attributes in the
Page_Load
function.
Hope this helps.