Print this page
Sunday, 20 January 2013 13:55

how to register script file from code behind file

Written by 
Rate this item
(0 votes)

you may need to register javascript file/css file from code
behind when needed.for this follow the codes below -

StringBuilder sb = new StringBuilder();

sb.AppendFormat("<link rel=\"stylesheet\" href=\"{0}/jquery-ui/jquery-ui.css \"
type=\"text/css\" />{1}", this.TemplateSourceDirectory, "\r\n");

sb.AppendFormat("<script type=\"text/javascript\"
this.TemplateSourceDirectory, "\r\n");

"Cp_Detail_Script", sb.ToString());

here i registered jquery-ui.min.js and jquery-ui.css
files in jquery-ui folder in my dotnetnuke modules directory.
there are no problems if you register in normal

Read 5603 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.
Login to post comments