Credit to http://geekswithblogs.net/rachit/archive/2007/01/14/103608.aspx
Finally a method that works ...
In the master page Page_Load event
protected void Page_Load(object sender, EventArgs e)
{
HtmlGenericControl myJs = new HtmlGenericControl();
myJs.TagName = "script";
myJs.Attributes.Add("type", "text/javascript");
myJs.Attributes.Add("language", "javascript"); //don't need it usually but for cross browser.
myJs.Attributes.Add("src", ResolveUrl("../Script/fileIO.js"));
this.Page.Header.Controls.Add(myJs);
}
Now you can reference its functions in the master page markup and in the content page markup.
Thursday, November 4, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment