我在我的 ASP.NET 页面中使用 ScriptManager,并希望添加一个 ScriptReference,它是这样的页面请求:
var id = 10;
tsm.CompositeScript.Scripts.Add(new ScriptReference("~/Response.aspx?action=test&id=" + id));
但它引发了一个错误:
'~/Response.aspx?action=test&id=10' is not a valid virtual path.
我应该动态添加这个脚本,我该怎么办?