且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ScriptManager.RegisterStartupScript中传递参数

更新时间:2023-12-05 23:24:10

您可以直接为第一个参数提及页面/控件名称. br/>
检查此链接[ ^ ]希望这会有所帮助.
You can mention the page/control name directly for the first parameter.

check this link [^] hope this helps.


对我来说很好

看这个


it works fine for me

look at this


string pageurl = "ViewBlogs.aspx?blogid=" + e.CommandArgument.ToString() + "&action=view";
            
            string script = "<script language='javascript'>viewblogs('" + pageurl + "');</script>";
            ScriptManager.RegisterStartupScript(Page, typeof(string), "clientScript", script, false);