Am I injecting this correctly?
string myScriptName = \"EventScriptBlock\";
string myScript = string.Empty;
//Verify script isn\'t already registered
if (!Cl
Both RegisterStartupScript and RegisterClientScriptBlock will work.
Problem lies in myScript (string variable).In myScript variable you need to use alert variable only, as whenever you use this, script tag will be added automatically to your page's HTML at runtime. To check this right on your page and see the source of the page.
protected void Page_Load(object sender, EventArgs e)
{
string myScript = string.Empty;
//myScript = "\n