Use External Javascript File Function in RegisterStartupScript Method

早过忘川 提交于 2019-12-13 06:51:54

问题


I put together my whole javascript functions in one file(let's say it for making clear, javascriptsample.js).

And i need to use one of the function, which is in that file, in my asp.net side using RegisterStartupScript.

How can i call this function?


回答1:


You must give a reference of the javascriptsample.js in your aspx page...

Aftre that you can use..

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>JavascriptFunctionname();</script>", false);


来源:https://stackoverflow.com/questions/22527688/use-external-javascript-file-function-in-registerstartupscript-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!