Thursday, February 5, 2015

How to put Javascript file (.js file) in a web server?

I want to put javascript in a web server. After that I need to inject that script in c# code using src="http:\...". Please tell me what to do from the beginning


Try this to inject the javascript file content from the C#.
Page.ClientScript.RegisterStartupScript(
    this.GetType(), 
    "scriptname", 
    "<script type='text/javascript' src='http://localhost/scripts/test.js' />",
    false);

No comments:

Post a Comment