You have to use RegisterClientScriptBlock to write a javascript funciton to
browser... to associate it... just use say onclick='function_name();' add
that to ur control...
Here's some code from my earlier post:
on aspx page
<td colspan="3">
<asp:LinkButton id="lnkUpdate"
runat="server">Update</asp:LinkButton>
<asp:HyperLink id="lnkCancel" onclick='CancelMe();' runat="server"
NavigateUrl="#">Cancel</asp:HyperLink>
</td>
in code behind .cs file within Page
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
// Form the script that is to be registered at client side.
String scriptString = "<script language=JavaScript> function CancelMe()
{";
scriptString += "window.history.back(); }</script>";
if(!this.IsClientScriptBlockRegistered("clientScriptCancel"))
this.RegisterClientScriptBlock("clientScriptCancel", scriptString);
if(!Page.IsPostBack)
...............