在RegisterStartupScript方法中使用外部Javascript文件功能 [英] Use External Javascript File Function in RegisterStartupScript Method
本文介绍了在RegisterStartupScript方法中使用外部Javascript文件功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将整个javascript函数放到一个文件中(为了清楚起见,我们将其称为javascriptsample.js).
I put together my whole javascript functions in one file(let's say it for making clear, javascriptsample.js).
我需要使用RegisterStartupScript在asp.net端使用该文件中的功能之一.
And i need to use one of the function, which is in that file, in my asp.net side using RegisterStartupScript.
如何调用此功能?
推荐答案
您必须在aspx页面中提供javascriptsample.js
的引用...
You must give a reference of the javascriptsample.js
in your aspx page...
可以使用的面积.
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "tmp", "<script type='text/javascript'>JavascriptFunctionname();</script>", false);
这篇关于在RegisterStartupScript方法中使用外部Javascript文件功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文