tag:blogger.com,1999:blog-660094329033919889.post7034720121190042433..comments2024-01-10T10:35:21.105+02:00Comments on DotNetNuke them!: Injecting CSS / Javascript on your page, revisedGyromyristishttp://www.blogger.com/profile/07078677584884156019noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-660094329033919889.post-79843480467917026762019-01-23T07:22:00.091+02:002019-01-23T07:22:00.091+02:00Thank you so much for this useful information.Thank you so much for this useful information.13 Below consultinghttp://www.13below.com/noreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-40231335215694395292012-10-30T06:35:49.794+02:002012-10-30T06:35:49.794+02:00Thanks for the CSS. It's really informative an...Thanks for the CSS. It's really informative and useful post. keep sharing similar stuff.Custom DotNetNuke Developmenthttp://www.dotnetnuke-developer.org/dnn-development.htmlnoreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-81948106948113003722012-02-11T14:26:51.760+02:002012-02-11T14:26:51.760+02:00QWill Strohl's Content Injection Module now se...QWill Strohl's Content Injection Module now seem to solve the problem http://wnsinj.codeplex.com/Geoffrey Morton-Haworthhttp://www.yalaworld.netnoreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-81278603107813506352011-10-14T15:11:58.663+03:002011-10-14T15:11:58.663+03:00Great tips dude.They are really helpful.
web desi...Great tips dude.They are really helpful.<br /><br /><a href="http://www.web-designs-company.com" rel="nofollow">web design company</a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-82357281649814833762011-09-21T19:32:47.285+03:002011-09-21T19:32:47.285+03:00I haven't got any more subtle implementation a...I haven't got any more subtle implementation at the moment, but I guess I'll need to create something better myself so just keep an eye here :)<br /><br />Regarding the number of includes, you can call AddCSS() or AddJS() as many times as you need to inside your Page_Init() function, using different script and/or CSS stylesheet paths. Each time you call it, the script/css that you have specified will be injected.Gyromyristishttps://www.blogger.com/profile/07078677584884156019noreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-74637123658944634202011-09-20T18:55:20.768+03:002011-09-20T18:55:20.768+03:00Thanks a bunch for this post, totally saved my day...Thanks a bunch for this post, totally saved my day (2 days!). My includes we're being left out on certain page refreshes. <br /><br />Is there a way I can add your code in a more subtle way? Some DNN include?<br /><br />Do you have an example that has more than one .js or .css include?Hughescohttps://www.blogger.com/profile/07374109603794522358noreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-9519750578164244022011-08-08T18:09:56.431+03:002011-08-08T18:09:56.431+03:00Brian Dukes:
In addition to my previous reply, he...Brian Dukes:<br /><br />In addition to my previous reply, here's a <a href="http://stackoverflow.com/questions/143486/unobtrusive-javascript-script-at-the-top-or-the-bottom-of-the-html-code" rel="nofollow">relevant discussion</a> at StackOverflow. It seems that the decision on where to put the script is not always an easy one - but you're right on the subject of load speeds anyway.Gyromyristishttps://www.blogger.com/profile/07078677584884156019noreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-74762884170268196662011-07-22T12:31:07.749+03:002011-07-22T12:31:07.749+03:00You're my life savior! Most of the scripts aro...You're my life savior! Most of the scripts around the Internet are no longer valid except yours! I really appreciate your contribution.GGeraniumhttps://www.blogger.com/profile/01484282879505244544noreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-31436763804313146162011-06-06T07:14:39.808+03:002011-06-06T07:14:39.808+03:00If we use the AddStyleSheet method from within a c...If we use the AddStyleSheet method from within a custom module and the page contains several custom modules is there a way to easily detect whether a certain stylesheet has already been added to the page?<br /><br />ThanksChris Lindleyhttps://www.blogger.com/profile/12483292788403813928noreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-92162171180931037152011-06-02T18:08:45.762+03:002011-06-02T18:08:45.762+03:00Placing scripts at the bottom of the page is good,...Placing scripts at the bottom of the page is good, but it depends on what they do.<br /><br />Don't forget that my aim is to provide a uniform way to add scripts AND css. So, in this context, the page header is the only common place. <br /><br />I will try using the AddStylesheet method, though, since I wasn't aware of it and seems interesting.Gyromyristishttps://www.blogger.com/profile/07078677584884156019noreply@blogger.comtag:blogger.com,1999:blog-660094329033919889.post-78037438372875912912011-06-02T18:03:06.720+03:002011-06-02T18:03:06.720+03:00An easier way to add stylesheets is to cast Page a...An easier way to add stylesheets is to cast <b>Page</b> as <b>DotNetNuke.Framework.CDefault</b> and then call <b>AddStyleSheet</b>.<br /><br />Also, for most scripts, it's better to optimize them to appear at the bottom of the page, instead of putting them in the header (so that they don't block the rendering of the page unnecessarily). <b>Page.ClientScript.RegisterStartupScript</b> will add script blocks towards the bottom of the page for you easily.Brian Dukeshttp://weblogs.asp.net/BrianDukesnoreply@blogger.com