Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 ScriptManager 类来生成标记后面的 javascript。但我不知道我应该使用哪种方法......位置必须在标签后面
我的英语很烂,希望表达清楚...
很难说出您需要什么,但如果您需要注册一些客户端脚本,请使用:
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "scriptName", "your java script", true);
或者,如果您需要注册在页面加载时运行的脚本,请使用:
ScriptManager.RegisterStartupScript(this, this.GetType(), "scriptName", "your javascript", true);