If you use jQuery or ASP.NET AJAX you can easily detect Ajax requests on the server by simply checking for the HTTP_X_REQUESTED_WITH HTTP Header. Both libraries automatically add this to the HTTP Header when they send a request. Here’s a little code snippet that returns true for Ajax requests. public static bool IsAjaxRequest() { return [...]
If you have visited sites like Smashing Magazine chances are high that you’ve seen articles with titles like “40 most used jQuery plugins”, or something similar to that. I find articles like that to be great for inspiration. You usually have a section for galleries/slideshows/carousels etc, I thought I’d implement one of those plugins in [...]
One hidden little feature that is nice to know about is the filesummary.config file. When you edit a file in EPiServer’s File Manager, you can edit the data for that file (simply right-click on the file and choose Edit File Summary). Which gives us this form. This is the standard form that comes with EPiServer. [...]
I’ve done a little spring cleaning, updating all EPiServer posts to now use EPiServer CMS 6, and making sure the code still works. I’ve also added the code for ShareIt and SlideShare Dynamic Content to EPiCode, and updated EPiCode.Extensions. They’re all now built against EPiServer CMS 6. My current projects on EPiCode EPiCode.Extensions FV.DynamicSlideShare FV.ShareIt [...]
I’ve just started learning Umbraco, which is a popular open source content management system, originally from Danmark, but now with developers across the world. Umbraco stores much of its data as XML in the database, and recommends using XSLT for transforming it to HTML. You can however use regular ASP.NET code if you wish (or [...]
28February 28, 2010, 01:26
Another little quick tip. I was browsing the EPiServer World forum and came across a common question. by David Green I am using the EpiServer:PageTree control to generate a nested <ul><li> list in the format below. However I am also using a dropdown menu system called UDM which requires that the class and id “udm” [...]
20February 20, 2010, 12:25
Just a little quick tip when needing to use either the Page object or the EPiServer CurrentPage object from a class file. HttpContext.Current will give you access to the current request, what we can do is cast HttpContext.Current.Handler (since Page implements the IHttpHandler interface) to System.Web.UI.Page. var page = HttpContext.Current.Handler as System.Web.UI.Page; if (page [...]
11February 11, 2010, 18:38
I finally got my hands on a copy of Visual Studio 2010 RC1! After playing around a bit, I stumbled across the new snippet functionality in Visual Studio 2010. You can now use snippets in the markup files as well (in previous versions you could only use the snippet functionality in code files like class/interfaces/code-behind [...]
Font sizing with CSS and browser support as always been a mystery to me. We used to use pixels, than we switched to ems and percent, then we switched back to pixels again?!.. In this post I’ve tried shedding some light on the matter and explaining the reason for this, and the different ways of [...]
29January 29, 2010, 17:10
This is the first post in a new series called “EPiServer code walkthrough”. What I’ll do is go through one new EPiServer module in each post. Writing a little about what it does, learn by reading its code, and hopefully contributing a little back to the project, if I see any bugs or harmful/unnecessary code [...]