简体   繁体   中英

Use External Javascript File Function in RegisterStartupScript Method

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?

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM