While creating a web part I had to use some JavaScript. There are definitely other ways of doing this, I am just sharing the way I did it.
JavaScript file would also reside in the same folder structure in 12 hive, however while adding it in the code, used the Client script Manager
////-- Adding JavaScript file ---------- ClientScriptManager cs = Page.ClientScript; if (!cs.IsClientScriptIncludeRegistered("tab_javascript")) { cs.RegisterClientScriptInclude(this.GetType(), "tab_javascript", "/_layouts/A/Scripts/Script.js"); } |
Please post a comment if you have other ways of doing this same thing… I’ll be happy to hear.
HaPpY CoDiNg... (Aurum)
No comments:
Post a Comment