Javascript Page.ClientScript.RegisterStartupScript未注入脚本
我无法使Javascript Page.ClientScript.RegisterStartupScript未注入脚本,javascript,c#,asp.net,Javascript,C#,Asp.net,我无法使页面.ClientScript.RegisterStartupScript正常工作。我已经浏览了所有关于stackoverflow和其他网站的可能建议,但似乎没有任何效果。我没有看到“警报”消息。我一直在简化代码,直到得到一个非常简单的HTML文件和一行C#代码 脚本只是没有附加到页面上(我在浏览器HTML中没有看到它)。我试着用。标记包围脚本,但它没有改变任何东西 正在从Page\u Load调用Page.ClientScript.RegisterStartupScript Page.
页面.ClientScript.RegisterStartupScript
正常工作。我已经浏览了所有关于stackoverflow和其他网站的可能建议,但似乎没有任何效果。我没有看到“警报”消息。我一直在简化代码,直到得到一个非常简单的HTML文件和一行C#代码
脚本只是没有附加到页面上(我在浏览器HTML中没有看到它)。我试着用。
标记包围脚本,但它没有改变任何东西
正在从Page\u Load
调用Page.ClientScript.RegisterStartupScript
Page.ClientScript.RegisterStartupScript(GetType(),
"AlertTab"," <script>alert('here!')</script>", false);
Page.ClientScript.RegisterStartupScript(GetType(),
“AlertTab”、“alert('here!')”,false);
是否从浏览器中显示html标记或页面源?
Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertTab", "Alert('here!')", true);
Page.ClientScript.RegisterStartupScript(GetType(),
"AlertTab"," <script>alert('here!')</script>", false);