Solution: In CreateChildControl function, use following code:
using System.Web.UI.HtmlControls;
HtmlGenericControl MyJS = new HtmlGenericControl("script");
MyJS.Attributes.Add("type", "text/javascript");
MyJS.Attributes.Add("src", "/_layouts/15/scripts/Mobile_Custom.js");
Page.Header.Controls.Add(MyJS);
HtmlGenericControl MyCSS = new HtmlGenericControl("link");
MyCSS.Attributes.Add("rel", "stylesheet");
MyCSS.Attributes.Add("href", "/_layouts/15/Styles/Mobile_Custom.css");
Page.Header.Controls.Add(MyCSS);
No comments:
Post a Comment