Add [removed] tag within <Head … /> tag in ServerControl (ASP.NET)?

后端 未结 1 957
悲哀的现实
悲哀的现实 2021-01-15 06:22

I\'m gonna use JQuery files in my custom ServerControl , thus I have to add below line within Head tag.



        
1条回答
  •  生来不讨喜
    2021-01-15 06:43

    You can register custom scripts using the ClientScriptManager.RegisterClientScriptInclude Method during the page load. Alternatively, you can just include the script in your .aspx page. If this is a public server control, the first method is probably more preferable.

    EDIT: alternatively you can register scripts in the tag of the page as follows:

    HtmlGenericControl jqueryInclude = new HtmlGenericControl("script");
    jqueryInclude.Attributes.Add("type", "text/javascript");
    jqueryInclude.Attributes.Add("src", "http://");
    Page.Header.Controls.Add(jqueryInclude);
    

    0 讨论(0)
提交回复
热议问题