.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> JQuery >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Link JavaScript at Runtime

Posted By:Sasi Prabhu       Posted Date: July 30, 2011    Points: 40    Category: JQuery    URL: http://www.dotnetspark.com  

Make Link the JavaScript File at Programatically.

To Link the JavaScript

To Link is Done through the Page InIt Event only.

Use the following Code :

protected void Page_Init(object sender, EventArgs e)
        HtmlGenericControl javascript = new HtmlGenericControl("script");
        javascript.Attributes["type"] = "text/javascript";
        javascript.Attributes["src"] = "Scripts/myscripts.js";


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend