Friday, November 7, 2014

asp net How to register script at the very bottom of the page

Use the following
// Define the name and type of the client scripts on the page.
String csname1 = "PopupScript";
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('Script at the bottom of form tag');";
    cs.RegisterStartupScript(cstype, csname1, cstext1, true);
}