Created
November 5, 2015 07:28
-
-
Save bestpika/fe6dbe65dba600a29284 to your computer and use it in GitHub Desktop.
執行網頁內 js 的方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void js(string func) | |
{ | |
var page = HttpContext.Current.Handler as Page; | |
page.ClientScript.RegisterClientScriptBlock(page.GetType(), "js", func, true); | |
// var script = new LiteralControl(string.Format("<script>{0}</script>", func)); | |
// page.Controls.Add(script); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment