I want to execute following code on button click but the follwing code executes when I refresh the page as well. I don’t want that behaviour. Please help me.
string str = "Are you sure, you want to Approve this Record?";
this.ClientScript.RegisterStartupScript(typeof(Page), "Popup", "ConfirmApproval('" + str + "');", true);
your question in quite unclear. I assumed you use ASP.NET C# , here is the way:
then, in your page (remember to reference the class above):
See if it helps in your case.