Display Javascript Popup with Server side code
A quick and easy popup script that you can write in your asp.net server side code behind to show a javascript message window.
Simple add the below method in your code behind
public void Popup()
{
// Define the name and type of the client scripts on the page.
String csname1 = "PopupScript";
//String csname2 = "ButtonClickScript";
Type cstype = this.GetType();
// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;
// Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname1))
{
String cstext1 = "alert('Common are u still copying ...!');";
cs.RegisterStartupScript(cstype, csname1, cstext1, true);
}
}
and call it as Popup();
Thats it!
Simple add the below method in your code behind
public void Popup()
{
// Define the name and type of the client scripts on the page.
String csname1 = "PopupScript";
//String csname2 = "ButtonClickScript";
Type cstype = this.GetType();
// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;
// Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname1))
{
String cstext1 = "alert('Common are u still copying ...!');";
cs.RegisterStartupScript(cstype, csname1, cstext1, true);
}
}
and call it as Popup();
Thats it!
Thanks for sharing your post. Popup System in malaysia
ReplyDelete