Hi Edwin,
do something like you posted above:
<script runat="server">
protected override void OnLoad(EventArgs e)
{
string script = "function CustomPostback(){ " +
Page.ClientScript.GetPostBackEventReference(this, null) + "
}";
Page.ClientScript.RegisterClientScriptBlock(
GetType(), "MyScript", script, true);
base.OnLoad(e);
}
</script>
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" onclick="CustomPostback();" />
</div>
</form>
</body>
</html>
This is ASP.NET 2.0 code, in ASP.NET 1.1, the methods can be found on
the Page class, e.g. Page.RegisterClientScriptBlock.
Grtz, Wouter
Trainer - Info Support -
www.infosupport.com
www.dive-in-it.nl