how to display alert by using serverside code in asp.net? -



how to display alert by using serverside code in asp.net? -

i want execute next code on button click follwing code executes when refresh page well. don't want behaviour. please help me.

string str = "are sure, want approve record?"; this.clientscript.registerstartupscript(typeof(page), "popup", "confirmapproval('" + str + "');", true);

your question in quite unclear. assumed utilize asp.net c# , here way:

public static class clientmessagebox { public static void show(string message, command owner) { page page = (owner page) ?? owner.page; if (page == null) return; page.clientscript.registerstartupscript(owner.gettype(), "showmessage", string.format("<script type='text/javascript'>alert('{0}')</script>", message)); } }

then, in page (remember reference class above):

protected void page_load(object sender, eventargs e) { clientmessagebox.show("hello world", this); }

see if helps in case.

asp.net

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -