Archive of ASP.NET
-
Detecting Ajax requests on the server
Posted on April 6, 2010 by Frederik Vig in ASP.NET, JavaScriptIf 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...
Continue reading this entry → -
Getting the Page and EPiServer CurrentPage object from HttpContext
Posted on February 20, 2010 by Frederik Vig in ASP.NET, EPiServerJust 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...
Continue reading this entry → -
Visual Studio 2010 EPiServer Snippets
Posted on February 11, 2010 by Frederik Vig in ASP.NET, EPiServer, Visual StudioI 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...
Continue reading this entry → -
EPiServer code walkthrough #1 – 404 handler
Posted on January 29, 2010 by Frederik Vig in ASP.NET, C#, EPiServerThis 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...
Continue reading this entry → -
Html Helpers vs Server controls
Posted on December 8, 2009 by Frederik Vig in ASP.NETI received some very good comments on my post Extending PageData with some cool Html Helpers. Which made me want to explain my thoughts on the subject a bit more :). For me, most of the server controls...
Continue reading this entry → -
Creating a mobile version of a web site
Posted on October 4, 2009 by Frederik Vig in ASP.NET, CSS, EPiServer, Web designWhen building web sites we has developers or designers have to take into consideration all the different types of devices that can be used to access the web sites we create. Not just PC or Mac with Internet Explorer, Firefox,...
Continue reading this entry → -
Extending search field with suggestion box
Posted on September 17, 2009 by Frederik Vig in ASP.NET, Code Snippet, EPiServer, JavaScriptDisclaimer: In this example I've kept the code simple to make it easier to read and to give you an idea of how you might approach something like this with EPiServer. This code should not be used in production scenarios...
Continue reading this entry → -
Add class attribute to body element with ASP.NET web forms and Master Pages
Posted on August 27, 2009 by Frederik Vig in ASP.NET, Code SnippetOften I have to add a class to the HTML body element. This is a little code snippet that allows you to easily do this...
Continue reading this entry → -
Adding CSS and JavaScript files dynamically to your ASP.NET page
Posted on August 15, 2009 by Frederik Vig in ASP.NET, C#When starting a new project I always create a Master Page that holds the content that is most used across the site. In my Master Page I have a PlaceHolder for my JavaScript files at the bottom of...
Continue reading this entry → -
ASP.NET web forms and jQuery Thickbox plugin
Posted on July 13, 2009 by Frederik Vig in ASP.NET, JavaScriptUpdate Thickbox is no longer supported. Use another of jQuery's overlay/lightbox plugins. This post will remain for legacy purposes only. I'm very found of jQuery, and use the Thickbox plugin a lot in my project. I've not used...
Continue reading this entry →