<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Revium</title>
	<atom:link href="http://www.revium.com.au/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.revium.com.au</link>
	<description>All things web.</description>
	<lastBuildDate>Tue, 15 May 2012 00:50:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>FluentSecurity + MvcSiteMapProvider = Better .Net Security&#160;Management</title>
		<link>http://www.revium.com.au/articles/sandbox/fluentsecurity-mvcsitemapprovider-better-net-security-management/</link>
		<comments>http://www.revium.com.au/articles/sandbox/fluentsecurity-mvcsitemapprovider-better-net-security-management/#comments</comments>
		<pubDate>Tue, 08 May 2012 03:17:19 +0000</pubDate>
		<dc:creator>Mark Wiseman</dc:creator>
				<category><![CDATA[Revium Sandbox]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[FluentSecurity]]></category>
		<category><![CDATA[MVC3]]></category>
		<category><![CDATA[MvcSiteMapProvider]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2497</guid>
		<description><![CDATA[In my continual quest for find better ways of doing anything and everything this week I decided to tackle on of my arch nemesis:...


Related posts:<ol><li><a href='http://www.revium.com.au/articles/sandbox/aspnet-mvc-convert-view-to-word-document/' rel='bookmark' title='Permanent Link: Asp.Net MVC convert View to Word&nbsp;Document'>Asp.Net MVC convert View to Word&nbsp;Document</a> <small>One request we always seem to come across as developers...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/modified-properties-in-linq-to-sql/' rel='bookmark' title='Permanent Link: Modified properties in LINQ to&nbsp;SQL'>Modified properties in LINQ to&nbsp;SQL</a> <small>I&#8217;ve been recently quite surprised to learn that there is...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/sharepoint-people-photos/' rel='bookmark' title='Permanent Link: Sharepoint &#8211; Getting Photos from People and&nbsp;Groups'>Sharepoint &#8211; Getting Photos from People and&nbsp;Groups</a> <small>This is another task that seemed to escape me for...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In my continual quest for find better ways of doing anything and everything this week I decided to tackle on of my arch nemesis: Security in ASP.Net, specifically Security in ASP.Net MVC3. You might ask why? We all know that there are at least 2 easy ways to implement security in MVC3</p>
<ol>
<li>Authorize Attributes on Controllers and Actions</li>
<li>web.config locations</li>
</ol>
<p>Yuck! I hate both of them for the same reason: they become very difficult to manage. Authorize Attributes end up spread all over your application and web.config location elements require 7 lines of xml for 1 rule. So I went searching and came across a NuGet package called <a href="http://www.fluentsecurity.net/">FluentSecurity</a>.</p>
<p>The documentation covered all the examples I needed and you can define rules in only 1 line of code!</p>
<pre class="brush: c-sharp;">configuration.For<AccountController>.RequireRole("Administrator", "Legal");</pre>
<p>I ran into 2 difficulties when trying to implement this:</p>
<ol>
<li>Implementing an Access Denied page and re-direct to Login</li>
<li>Integrating FluentSecurity with MvcSiteMapProvider</li>
</ol>
<p>If you want to skip all the work and get straight to a working example download a sample application here <a href='http://www.revium.com.au/cms/wp-content/uploads/2012/05/FluentSecurityAndMvcSiteMapProvider.zip'>FluentSecurityAndMvcSiteMapProvider.zip</a></p>
<h2>Implementing an Access Denied page and re-direct to Login</h2>
<p>The current NuGet version (1.4 as at 05/2012) required that you use <a href="http://structuremap.net">StructureMap</a> or another IoC container to implement a custom IPolicyViolationHandler. I wasn&#8217;t using either but discovered that it is not a requirement in version 2 which is in alpha at the time of writing but works fine for me. So make sure either the Version you get from NuGet is at least 2.0 or got to GitHub to get the latest version.</p>
<p>First we need to create a class implementing IPolicyViolationHandler.<br />
The class that we create will:</p>
<ul>
<li>Send unauthenticated users to a shared view called AccessDenied</li>
<li>Redirect authenticated users without access to the current controller to the Account controllers LogIn action</li>
</ul>
<pre class="brush: c-sharp;">using System.Web.Mvc;
using System.Web.Routing;
using FluentSecurity;

public class DefaultPolicyViolationHandler : IPolicyViolationHandler
{
    public string ViewName = "AccessDenied";

    public ActionResult Handle(PolicyViolationException exception)
    {
        if (SecurityHelper.UserIsAuthenticated())
        {
            return new ViewResult { ViewName = ViewName };
        }
        else
        {
            RouteValueDictionary rvd = new RouteValueDictionary();

            if (System.Web.HttpContext.Current.Request.RawUrl != "/")
                rvd["ReturnUrl"] = System.Web.HttpContext.Current.Request.RawUrl;

            rvd["controller"] = "Account";
            rvd["action"] = "LogOn";
            rvd["area"] = "";

            return new RedirectToRouteResult(rvd);
        }
    }
}</pre>
<p>Now we need to set / tell FluentSecurity to use our DefaultPolicyViolationHandler. For this I created a SecurityHelper class.</p>
<pre class="brush: c-sharp;">using System.Collections.Generic;
using System.Linq;
using System.Web;

using FluentSecurity;
using FluentSecurityAndMvcSiteMapProvider.Areas.Admin.Controllers;
using FluentSecurityAndMvcSiteMapProvider.Controllers;

public static class SecurityHelper
{
    public static ISecurityConfiguration SetupFluentSecurity()
    {
        SecurityConfigurator.Configure(configuration =&gt;
        {
            // Let Fluent Security know how to get the authentication status of the current user
            configuration.GetAuthenticationStatusFrom(SecurityHelper.UserIsAuthenticated);
            configuration.GetRolesFrom(SecurityHelper.UserRoles);

            // It is reccommended not to use this setting. For all of our applications users must always be authenticated.
            configuration.IgnoreMissingConfiguration();

            configuration.DefaultPolicyViolationHandlerIs(() =&gt; new DefaultPolicyViolationHandler());

            //Make sure user must be authenticated but allow unauthenticated access to the logon screen
            configuration.ForAllControllers().DenyAnonymousAccess();
            configuration.For&lt;AccountController&gt;(ac =&gt; ac.LogOn()).Ignore();

            //first deny access to all users except Administrators
            configuration.ForAllControllersInNamespaceContainingType&lt;AdminController&gt;()
                .DenyAuthenticatedAccess()
                .RequireRole(RolesEnum.AdminRole.ToString());

            //If any users have access to part of the admin console they will access to the admin dashboard
            configuration.For&lt;AdminController&gt;().RequireRole(RolesEnum.AdminRole.ToString(), RolesEnum.LegalRole.ToString());

            //grant access to any other controllers in the admin area
            configuration.For&lt;LegalController&gt;().RequireRole(RolesEnum.AdminRole.ToString(), RolesEnum.LegalRole.ToString());

        });

        return SecurityConfiguration.Current;
    }

    public static bool UserIsAuthenticated()
    {
        var currentUser = HttpContext.Current.User;
        return !string.IsNullOrEmpty(currentUser.Identity.Name);
    }

    public static IEnumerable&lt;object&gt; UserRoles()
    {
        var currentUser = HttpContext.Current.User;
        return string.IsNullOrEmpty(currentUser.Identity.Name) ? null : System.Web.Security.Roles.GetRolesForUser(currentUser.Identity.Name);
    }
}</pre>
<p>Finally configure our system to use FluentSecurity in Global.asax.cs</p>
<pre class="brush: c-sharp;">using System.Web.Mvc;
using System.Web.Routing;

using FluentSecurity;

namespace FluentSecurityAndMvcSiteMapProvider
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode,
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());

            //required for FluentSecurity
            filters.Add(new HandleSecurityAttribute(), 0);
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );
        }

        protected void Application_Start()
        {
            //Configure FluentSecurity
            SecurityHelper.SetupFluentSecurity();

            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }
    }
}</pre>
<h2>Integrating FluentSecurity with MvcSiteMapProvider</h2>
<p>With security working I needed to filter my site map so unauthenticated users can&#8217;t see menu items they shouldn&#8217;t. Becase we love to user MvcSiteMapProvider I could have easily just added a role attribute to each mvcSiteMapNode but then we are doubling up on security definitions and I just can&#8217;t have that.</p>
<p>To hook into MvcSiteMapProvier and use our own Visibility provider we needed to do a few things</p>
<ul>
<li>Create a new function in the SecurityHelper to check if a user has access to a particular action</li>
<li>Create a new class implementing ISiteMapNodeVisibilityProvider</li>
</ul>
<p>Creating ActionIsAllowedForUser. The one thing that is important to note about this function is that GetContainerFor asks for a parameter named <em>controllerName</em>. This is actually after the controller<strong>Namespace</strong>.</p>
<pre class="brush: c-sharp;">public static class SecurityHelper
{
    public static ISecurityConfiguration SetupFluentSecurity()
    {
        //...
    }

    public static bool UserIsAuthenticated()
    {
        //...
    }

    public static IEnumerable&lt;object&gt; UserRoles()
    {
        //...
    }

    public static bool ActionIsAllowedForUser(string controllerNamespace, string actionName)
    {
        var configuration = SecurityConfiguration.Current;

        var policyContainer = configuration.PolicyContainers.GetContainerFor(controllerNamespace, actionName);
        if (policyContainer != null)
        {
            var context = SecurityContext.Current;
            var results = policyContainer.EnforcePolicies(context);
            return results.All(x =&gt; x.ViolationOccured == false);
        }
        return true;
    }</pre>
<p>Now we can implement a SiteMapNodeVisibilityProvider to call ActionIsAllowedForUser. Lucky MvcSiteMapProvider provides us with this wonderful function that will get the full controller namespace for us!</p>
<pre class="brush: c-sharp;">using System.Collections.Generic;
using System.Web;

using MvcSiteMapProvider;
using MvcSiteMapProvider.Extensibility;

public class ReviumVisibilityProvider : ISiteMapNodeVisibilityProvider
{
    public bool IsVisible(SiteMapNode node, HttpContext context, IDictionary sourceMetadata)
    {
        // Convert to MvcSiteMapNode
        var mvcNode = node as MvcSiteMapNode;
        if (mvcNode == null)
        {
            return true;
        }

        //First check the visibility based on user roles
        string controllerNamespace = (new DefaultControllerTypeResolver()).ResolveControllerType(mvcNode.Area, mvcNode.Controller).FullName;
        bool isVisible = SecurityHelper.ActionIsAllowedForUser(controllerNamespace, mvcNode.Action);
        if (!isVisible)
            return false;

        //Process Other Visibility Rules
        //...

        return true;
    }
}</pre>
<p>And that&#8217;s it! We now have a site that full implements FluentSecurity for validation, displays the appropriate Access denied or login page and displays the correct site map foe each user.</p>
<p>Checkout a working version here <a href='http://www.revium.com.au/cms/wp-content/uploads/2012/05/FluentSecurityAndMvcSiteMapProvider.zip'>FluentSecurityAndMvcSiteMapProvider.zip</a></p>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/articles/sandbox/aspnet-mvc-convert-view-to-word-document/' rel='bookmark' title='Permanent Link: Asp.Net MVC convert View to Word&nbsp;Document'>Asp.Net MVC convert View to Word&nbsp;Document</a> <small>One request we always seem to come across as developers...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/modified-properties-in-linq-to-sql/' rel='bookmark' title='Permanent Link: Modified properties in LINQ to&nbsp;SQL'>Modified properties in LINQ to&nbsp;SQL</a> <small>I&#8217;ve been recently quite surprised to learn that there is...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/sharepoint-people-photos/' rel='bookmark' title='Permanent Link: Sharepoint &#8211; Getting Photos from People and&nbsp;Groups'>Sharepoint &#8211; Getting Photos from People and&nbsp;Groups</a> <small>This is another task that seemed to escape me for...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/articles/sandbox/fluentsecurity-mvcsitemapprovider-better-net-security-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Revium To Deliver The ACCC&#8217;s Energy Price Comparison&#160;website</title>
		<link>http://www.revium.com.au/news/revium-to-deliver-the-acccs-energy-price-comparison-website/</link>
		<comments>http://www.revium.com.au/news/revium-to-deliver-the-acccs-energy-price-comparison-website/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 06:05:40 +0000</pubDate>
		<dc:creator>peter.stone</dc:creator>
				<category><![CDATA[Revium News]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2485</guid>
		<description><![CDATA[The ACCC selects Melbourne Based Digital Agency Revium to deliver the Australian Energy Regulator’s Online
Energy Price Comparison website.
The major purpose of the energy price...


Related posts:<ol><li><a href='http://www.revium.com.au/articles/blog/new-products-launch-and-redesign-of-simply-energy-website/' rel='bookmark' title='Permanent Link: New Products Launch and Redesign of Simply Energy&nbsp;website'>New Products Launch and Redesign of Simply Energy&nbsp;website</a> <small>Over the last few weeks the team has been busy...</small></li>
<li><a href='http://www.revium.com.au/news/simply-energy-public-website-goes-cms/' rel='bookmark' title='Permanent Link: Simply Energy public website goes&nbsp;CMS'>Simply Energy public website goes&nbsp;CMS</a> <small>After a few months of development and testing efforts Simply...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/the-art-of-4-dimensional-database-design/' rel='bookmark' title='Permanent Link: The art of 4 dimensional database&nbsp;design'>The art of 4 dimensional database&nbsp;design</a> <small>When it comes down to it, a web application is...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The ACCC selects Melbourne Based Digital Agency Revium to deliver the Australian Energy Regulator’s Online<br />
Energy Price Comparison website.</p>
<p>The major purpose of the energy price comparison website is to assist small customers to navigate the often<br />
complex electricity and gas retail markets by allowing them to compare the standing offer prices and market<br />
offer prices available to them from all retailers.</p>
<p>Revium was selected from a number of leading Australian digital agencies. Revium’s Managing Partner, Andrew<br />
Elllet says, “Revium is pleased to partner with the AER to develop this important energy price comparison<br />
website site for all Australians. Revium has a long history of developing tools and resources for the web,<br />
combining our creative and commercial flair with our technical prowess for all things web.”</p>
<p>The Australian Government requires the Australian Energy Regulator (AER) under the Customer Framework to<br />
develop and operate an online energy price comparison service and publish detailed information regarding<br />
energy efficiency generally and electricity bill benchmarking in particular.</p>
<p>The target date for the website to go live is July 1st, 2012.</p>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/articles/blog/new-products-launch-and-redesign-of-simply-energy-website/' rel='bookmark' title='Permanent Link: New Products Launch and Redesign of Simply Energy&nbsp;website'>New Products Launch and Redesign of Simply Energy&nbsp;website</a> <small>Over the last few weeks the team has been busy...</small></li>
<li><a href='http://www.revium.com.au/news/simply-energy-public-website-goes-cms/' rel='bookmark' title='Permanent Link: Simply Energy public website goes&nbsp;CMS'>Simply Energy public website goes&nbsp;CMS</a> <small>After a few months of development and testing efforts Simply...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/the-art-of-4-dimensional-database-design/' rel='bookmark' title='Permanent Link: The art of 4 dimensional database&nbsp;design'>The art of 4 dimensional database&nbsp;design</a> <small>When it comes down to it, a web application is...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/news/revium-to-deliver-the-acccs-energy-price-comparison-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Responsive Web&#160;Design</title>
		<link>http://www.revium.com.au/articles/sandbox/responsive-web-design/</link>
		<comments>http://www.revium.com.au/articles/sandbox/responsive-web-design/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 04:03:09 +0000</pubDate>
		<dc:creator>Christian von Rohr</dc:creator>
				<category><![CDATA[Revium Sandbox]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2457</guid>
		<description><![CDATA[From big to small
In most recent times monitors have increased in size and 21 inch monitors and bigger are very common. This allowed web...


Related posts:<ol><li><a href='http://www.revium.com.au/articles/sandbox/creating-deployment-packages-in-svn/' rel='bookmark' title='Permanent Link: Creating deployment packages in&nbsp;SVN'>Creating deployment packages in&nbsp;SVN</a> <small>In software development (in an ASP.NET web development in particular)...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/developing-faster-web-forms-in-net/' rel='bookmark' title='Permanent Link: Developing faster web forms in&nbsp;.NET'>Developing faster web forms in&nbsp;.NET</a> <small>Quite often, I develop web forms containing  heavy elements, in...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/structured-structure-through-card-sorting/' rel='bookmark' title='Permanent Link: Structured structure through card&nbsp;sorting'>Structured structure through card&nbsp;sorting</a> <small>From personal and professional experience, website&#8217;s that provide information in...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<h1>From big to small</h1>
<p>In most recent times monitors have increased in size and 21 inch monitors and bigger are very common. This allowed web designers to build websites that show more information at a time to the user and to use striking images in their layout.<br />
Nowadays many websites are having big image slides at the entree and are using big’n’bold fonts. The content is split up in different columns and there is so much content on one page that the mouse wheel has to be oiled properly.</p>
<p>An era of new mobile devices which allowed surfing through the web adequately changed all. Sure, it is easy viewing and navigating the websites with them. But all that zooming and dragging ends in a bad user experience. Especially, if there are elements that are not or just barely accessible by touch interfaces (such as mouse-over menus). Therefore, a lot of companies brought up special mobile sites that were developed exclusively for that new screen size.<br />
But new devices appeared with lots of different resolutions, and every one of these mobile devices can be used in portrait and landscape mode, which would end in an endless development of different mobile sites.</p>
<h1>The solution – be responsive</h1>
<p>To pay attention to this phenomenon, a new thinking of web design is needed. Today a good web site has to be flexible for the use of different screen resolutions. This new trend is called Responsive Web Design. Thus there is no need to completely redesign the website for each resolution, but the single website has to respond to the user’s device. But what does “respond” mean in this case?</p>
<p>A website can respond in several ways. The most effective way is to hide elements like banners, info boxes and graphical elements completely. Another way to respond is to make the layout flexible to the screen. This means that images don’t have a fixed width, but are growing or shrinking with the screen boundaries (e.g. header images). With special techniques it is possible to load smaller sized versions of the images, so the website will be loaded much faster.<br />
Furthermore, adjoined contents can be reranged to single column to fit most mobile devices dimension. At last but not least, elements and fonts that were designed for large screens can be restyled to more space-saving elements.</p>
<p>And the good thing is: Responsive Web Design is easy to implement from the technical point of view, assume the website structure was set up appropriately, which includes grid layouts instead of table layouts etc. Furthermore, no JavaScript is used. All what is needed is a so-called Media Query (<a href="http://www.w3.org/TR/css3-mediaqueries" target="_blank">www.w3.org/TR/css3-mediaqueries</a>) and a CSS file that restyles the layout for smaller devices.</p>
<p>For example, let’s use a special “mobile.css” style sheet for resolutions lower than 480px (e.g. iPhones). So the HTML Media Query would look like this:</p>
<pre class="brush:html;">

&lt;link rel="stylesheet" type="text/css"
media="screen and (max-device-width: 480px)" href="mobile.css" /&gt;</pre>
<p>Additionally to the ordinary media type “screen” a “max-device-width” can be defined. This condition can also be set for “device-width” and “orientation” (landscape/portrait). This is possible in an existing style sheet too, as following:</p>
<pre class="brush:css;">
@media only screen and (max-device-width: 480px) {
/* style content */
}</pre>
<p>Most browsers are supporting Media Queries. The most well-known exceptions are the Internet Explorer older than version 9. Regarding browsers on mobile devices this is no problem as mobile devices are usually updated well and have originally modern browsers. If there is nevertheless support for older Internet Explorer versions needed, a special JavaScript framework can fix this for you (<a href="http://code.google.com/p/css3-mediaqueries-js/" target="_blank">http://code.google.com/p/css3-mediaqueries-js/</a>).</p>
<h1>We are responsive</h1>
<p>Normally, it is good to take account of Responsive Web Design at the beginning of the conceptual phase, so the layout can be built for lower screens and then elements are added step-by-step for larger screen resolutions.<br />
But it is also possible to take an existing website and make it responsive. How easy this undertaking would be depends on the structure and the content of the website.</p>
<p>We did this for example for one of our product sites on <a href="http://www.abstractsmanager.com/" target="_blank">www.abstractsmanager.com</a>. At the beginning, the structure had to be analysed and weighted for the importance of the different elements.</p>
<div id="attachment_2467" class="wp-caption alignnone" style="width: 344px"><a href="http://www.revium.com.au/cms/wp-content/uploads/2012/02/abstractsmanager_website1.png"><img class="size-full wp-image-2467    " title="abstractsmanager.com website" src="http://www.revium.com.au/cms/wp-content/uploads/2012/02/abstractsmanager_website1.png" alt="" width="334" height="432" /></a><p class="wp-caption-text">abstractsmanager.com website</p></div>
<p>As mentioned before, there are several ways to make a site responsive. So we decided to remove the upper teaser and remove some additional info, which is not crucial to know. For better overview, the different columns have been rearranged among each other and use now the full available width of the device. At last, some parts of the footer content were stashed. The sitemap in the footer is still there in the lower resolutions, as it is a good user experience because the user doesn’t have to scroll up again to navigate to other pages.</p>
<p>A big issue was that the title background graphics all had fixed sizes, which does not allow adjusting the width to the screen width. Fortunately, modern browsers as those of mobile devices allow CSS3. By dint of CSS3 the gradients and round corners can all be integrated with CSS styles.</p>
<div id="attachment_2472" class="wp-caption alignnone" style="width: 488px"><a href="http://www.revium.com.au/cms/wp-content/uploads/2012/02/abstractsmanager_structure.png"><img class="size-full wp-image-2472 " title="abstractsmanager.com structure modification" src="http://www.revium.com.au/cms/wp-content/uploads/2012/02/abstractsmanager_structure.png" alt="" width="478" height="339" /></a><p class="wp-caption-text">abstractsmanager.com structure modification</p></div>
<p>&nbsp;</p>
<p>Afterwards, just a few styles for the forms and listings had to be made. But all in all, just one CSS file was added and the Media Query was put into the header. No content changes were made, no tags were added, all CSS.</p>
<div id="attachment_2473" class="wp-caption alignnone" style="width: 328px"><a href="http://www.revium.com.au/cms/wp-content/uploads/2012/02/abstractsmanager_responsive.png"><img class="size-full wp-image-2473 " title="abstractsmanager.com - Responsive layout" src="http://www.revium.com.au/cms/wp-content/uploads/2012/02/abstractsmanager_responsive.png" alt="" width="318" height="669" /></a><p class="wp-caption-text">abstractsmanager.com - Responsive layout</p></div>
<h1></h1>
<h1>Should you be responsive too?</h1>
<p>As said at the beginning, modern devices allow accessing webpages adequately. However, there is a huge amount of new devices coming out and the website should be tested at least on smaller screens. There is always somebody with a smart phone or a tablet around the corner.<br />
Nevertheless, statistics state that mobile users have high expectations when they surf through the web, first and foremost in case of speed. This statistics have shown that 59% of the users are leaving if the page has not loaded within 5 seconds and most users are expecting a load time of 3 seconds or less. With smaller and fewer graphics the site speed can be increased a lot. A good styled and formatted content for a better readability on mobile devices would help the user and increase the user experience additionally.</p>
<p><strong>Links</strong></p>
<ul>
<li><a href="http://caniuse.com/#feat=css-mediaqueries" target="_blank">http://caniuse.com/#feat=css-mediaqueries</a></li>
<li><a href="http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/" target="_blank">http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/</a></li>
<li><a href="https://ilocalsearch.net/what-do-mobile-users-want" target="_blank">https://ilocalsearch.net/what-do-mobile-users-want</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/articles/sandbox/creating-deployment-packages-in-svn/' rel='bookmark' title='Permanent Link: Creating deployment packages in&nbsp;SVN'>Creating deployment packages in&nbsp;SVN</a> <small>In software development (in an ASP.NET web development in particular)...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/developing-faster-web-forms-in-net/' rel='bookmark' title='Permanent Link: Developing faster web forms in&nbsp;.NET'>Developing faster web forms in&nbsp;.NET</a> <small>Quite often, I develop web forms containing  heavy elements, in...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/structured-structure-through-card-sorting/' rel='bookmark' title='Permanent Link: Structured structure through card&nbsp;sorting'>Structured structure through card&nbsp;sorting</a> <small>From personal and professional experience, website&#8217;s that provide information in...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/articles/sandbox/responsive-web-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vermont Consulting website&#160;launched</title>
		<link>http://www.revium.com.au/news/vermont-consulting-website-launched/</link>
		<comments>http://www.revium.com.au/news/vermont-consulting-website-launched/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 23:03:26 +0000</pubDate>
		<dc:creator>Liani Liebenberg</dc:creator>
				<category><![CDATA[Revium News]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2444</guid>
		<description><![CDATA[Revium has been working closely with Taylor and Grace to convert a website they have designed to HTML5 and launch it in time for the...


Related posts:<ol><li><a href='http://www.revium.com.au/news/revium-is-born/' rel='bookmark' title='Permanent Link: Revium is&nbsp;born.'>Revium is&nbsp;born.</a> <small>At 1 minute past midnight today, a new company named...</small></li>
<li><a href='http://www.revium.com.au/news/destination-melbourne-new-site-launched/' rel='bookmark' title='Permanent Link: Destination Melbourne new site&nbsp;launched!'>Destination Melbourne new site&nbsp;launched!</a> <small>After working closely with the team at Destination Melbourne for...</small></li>
<li><a href='http://www.revium.com.au/news/mtdata-australian-and-british-sites-launched/' rel='bookmark' title='Permanent Link: MTData Australian and British sites&nbsp;launched!'>MTData Australian and British sites&nbsp;launched!</a> <small>Revium has been working closely with the MTData team since...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Revium has been working closely with <a href="http://www.taylorandgrace.com.au/index.htm" target="_blank">Taylor and Grace</a> to convert a website they have <a href="http://www.vermontconsulting.com.au/" target="_blank">designed</a> to HTML5 and launch it in time for the beta presentation of the <a href="http://rabs.eqitas.com.au/auth/login" target="_blank">Eqitas</a> system.   Revium applied the new branding to the Eqitas system and helped with the system document updates to reflect the new online branding.</p>
<p>Revium is looking forward to working with <a href="http://www.vermontconsulting.com.au/" target="_blank">Vermont Consulting</a> in the future to further improve the Eqitas system.</p>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/news/revium-is-born/' rel='bookmark' title='Permanent Link: Revium is&nbsp;born.'>Revium is&nbsp;born.</a> <small>At 1 minute past midnight today, a new company named...</small></li>
<li><a href='http://www.revium.com.au/news/destination-melbourne-new-site-launched/' rel='bookmark' title='Permanent Link: Destination Melbourne new site&nbsp;launched!'>Destination Melbourne new site&nbsp;launched!</a> <small>After working closely with the team at Destination Melbourne for...</small></li>
<li><a href='http://www.revium.com.au/news/mtdata-australian-and-british-sites-launched/' rel='bookmark' title='Permanent Link: MTData Australian and British sites&nbsp;launched!'>MTData Australian and British sites&nbsp;launched!</a> <small>Revium has been working closely with the MTData team since...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/news/vermont-consulting-website-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Compliance Monitoring Committee&#8217;s website&#160;launched</title>
		<link>http://www.revium.com.au/news/code-compliance-monitoring-committees-website-launched/</link>
		<comments>http://www.revium.com.au/news/code-compliance-monitoring-committees-website-launched/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 22:57:28 +0000</pubDate>
		<dc:creator>Liani Liebenberg</dc:creator>
				<category><![CDATA[Revium News]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2441</guid>
		<description><![CDATA[Revium launched the Code Compliance Monitoring Committee&#8217;s (CCMC) new website last week.  Is has been modelled on the Code Compliance Committee&#8217;s (CCC) website and enables complainants...


Related posts:<ol><li><a href='http://www.revium.com.au/articles/blog/new-project-with-financial-ombudsman-service/' rel='bookmark' title='Permanent Link: New project with Financial Ombudsman&nbsp;Service'>New project with Financial Ombudsman&nbsp;Service</a> <small>We recently kicked off a new project with the Financial...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/email-source-code-in-ms-outlook/' rel='bookmark' title='Permanent Link: Email source code in MS&nbsp;Outlook'>Email source code in MS&nbsp;Outlook</a> <small>The Problem I&#8217;m sure some of you may have been...</small></li>
<li><a href='http://www.revium.com.au/news/new-aequus-website-goes-live/' rel='bookmark' title='Permanent Link: New Aequus website goes&nbsp;live'>New Aequus website goes&nbsp;live</a> <small>Revium are excited to announce the launch of the new...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Revium launched the <a href="http://www.ccmc.org.au/" target="_blank">Code Compliance Monitoring Committee&#8217;s</a> (CCMC) new website last week.  Is has been modelled on the Code Compliance Committee&#8217;s (CCC) website and enables complainants to lodge complaints online.</p>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/articles/blog/new-project-with-financial-ombudsman-service/' rel='bookmark' title='Permanent Link: New project with Financial Ombudsman&nbsp;Service'>New project with Financial Ombudsman&nbsp;Service</a> <small>We recently kicked off a new project with the Financial...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/email-source-code-in-ms-outlook/' rel='bookmark' title='Permanent Link: Email source code in MS&nbsp;Outlook'>Email source code in MS&nbsp;Outlook</a> <small>The Problem I&#8217;m sure some of you may have been...</small></li>
<li><a href='http://www.revium.com.au/news/new-aequus-website-goes-live/' rel='bookmark' title='Permanent Link: New Aequus website goes&nbsp;live'>New Aequus website goes&nbsp;live</a> <small>Revium are excited to announce the launch of the new...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/news/code-compliance-monitoring-committees-website-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Revium: Victorian Government eService&#160;provider</title>
		<link>http://www.revium.com.au/news/revium-victorian-government-eservice-provider/</link>
		<comments>http://www.revium.com.au/news/revium-victorian-government-eservice-provider/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 03:46:07 +0000</pubDate>
		<dc:creator>Rendle Williams</dc:creator>
				<category><![CDATA[Revium Blog]]></category>
		<category><![CDATA[Revium News]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2437</guid>
		<description><![CDATA[Revium is pleased to be accepted on the refreshed Victorian eServices Panel, and proud to be able to provide the Victorian Government with Systems...


Related posts:<ol><li><a href='http://www.revium.com.au/news/collaborating-with-government/' rel='bookmark' title='Permanent Link: Collaborating with&nbsp;Government'>Collaborating with&nbsp;Government</a> <small>Revium is actively involved in the Federal Government&#8217;s R&amp;D program...</small></li>
<li><a href='http://www.revium.com.au/news/revium-end-of-year-party/' rel='bookmark' title='Permanent Link: Revium End of Year&nbsp;Party'>Revium End of Year&nbsp;Party</a> <small>Seeing as we all worked so hard during the year,...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/how-much-does-the-media-and-government-effect-our-business-confidence/' rel='bookmark' title='Permanent Link: How much does the media and government effect our business&nbsp;confidence?'>How much does the media and government effect our business&nbsp;confidence?</a> <small>Have you noticed the GFC? And I don&#8217;t mean the...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Revium is pleased to be accepted on the refreshed Victorian eServices Panel, and proud to be able to provide the Victorian Government with Systems and Solutions, as well as Design and Development services.</p>
<p>Revium has been delivering successful custom software development services and a trusted web advisor to Victorian organisations for over a decade.  Revium’s panel term runs until 30 June 2014, with a possibility of two one-year extensions.  Being a member of these panels highlights Revium’s specialist knowledge, capability and credibility in providing services in the Government arena and confirms its position as a leading IT provider.</p>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/news/collaborating-with-government/' rel='bookmark' title='Permanent Link: Collaborating with&nbsp;Government'>Collaborating with&nbsp;Government</a> <small>Revium is actively involved in the Federal Government&#8217;s R&amp;D program...</small></li>
<li><a href='http://www.revium.com.au/news/revium-end-of-year-party/' rel='bookmark' title='Permanent Link: Revium End of Year&nbsp;Party'>Revium End of Year&nbsp;Party</a> <small>Seeing as we all worked so hard during the year,...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/how-much-does-the-media-and-government-effect-our-business-confidence/' rel='bookmark' title='Permanent Link: How much does the media and government effect our business&nbsp;confidence?'>How much does the media and government effect our business&nbsp;confidence?</a> <small>Have you noticed the GFC? And I don&#8217;t mean the...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/news/revium-victorian-government-eservice-provider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BelcherPage2012 website goes for&#160;gold</title>
		<link>http://www.revium.com.au/news/belcherpage2012-website-goes-for-gold/</link>
		<comments>http://www.revium.com.au/news/belcherpage2012-website-goes-for-gold/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 05:20:45 +0000</pubDate>
		<dc:creator>James Fulton</dc:creator>
				<category><![CDATA[Revium News]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2432</guid>
		<description><![CDATA[Revium present to your their latest website promoting Mat Belcher and Malcom Page&#8217;s quest for gold at the 2012 London Olympics
Revium designed and developed...


Related posts:<ol><li><a href='http://www.revium.com.au/articles/blog/basic-introduction-3-ways-to-get-website-traffic-%e2%80%93-part-3/' rel='bookmark' title='Permanent Link: Basic introduction: 3 ways to get website traffic – Part&nbsp;3'>Basic introduction: 3 ways to get website traffic – Part&nbsp;3</a> <small>There is one common characteristic that exists in both buying...</small></li>
<li><a href='http://www.revium.com.au/news/new-aequus-website-goes-live/' rel='bookmark' title='Permanent Link: New Aequus website goes&nbsp;live'>New Aequus website goes&nbsp;live</a> <small>Revium are excited to announce the launch of the new...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/social-media-a-fad-or-here-to-stay/' rel='bookmark' title='Permanent Link: Social Media &#8211; a fad or here to&nbsp;stay?'>Social Media &#8211; a fad or here to&nbsp;stay?</a> <small>Whilst attending International Customer Service Week there were a lot...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Revium present to your their latest website promoting Mat Belcher and Malcom Page&#8217;s quest for gold at the 2012 London Olympics</p>
<p>Revium designed and developed a brochure website to promote the lead up to the 2012 London Olympics for the BelcherPage2012 team. Mat and Malcom were seeking a solution that not only provided information about the team, but also had a strong focus on social media.</p>
<p>Make sure you view the website <a href="http://www.belcherpage2012.com" target="_blank">www.belcherpage2012.com</a> and don&#8217;t forget to cheer on Mat and Malcom in the 2012 London games.</p>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/articles/blog/basic-introduction-3-ways-to-get-website-traffic-%e2%80%93-part-3/' rel='bookmark' title='Permanent Link: Basic introduction: 3 ways to get website traffic – Part&nbsp;3'>Basic introduction: 3 ways to get website traffic – Part&nbsp;3</a> <small>There is one common characteristic that exists in both buying...</small></li>
<li><a href='http://www.revium.com.au/news/new-aequus-website-goes-live/' rel='bookmark' title='Permanent Link: New Aequus website goes&nbsp;live'>New Aequus website goes&nbsp;live</a> <small>Revium are excited to announce the launch of the new...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/social-media-a-fad-or-here-to-stay/' rel='bookmark' title='Permanent Link: Social Media &#8211; a fad or here to&nbsp;stay?'>Social Media &#8211; a fad or here to&nbsp;stay?</a> <small>Whilst attending International Customer Service Week there were a lot...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/news/belcherpage2012-website-goes-for-gold/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tangshan Burak&#8217;s website overhaul goes&#160;live.</title>
		<link>http://www.revium.com.au/news/tangshan-buraks-website-overhaul-goes-live/</link>
		<comments>http://www.revium.com.au/news/tangshan-buraks-website-overhaul-goes-live/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 03:04:18 +0000</pubDate>
		<dc:creator>James Fulton</dc:creator>
				<category><![CDATA[Revium News]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2428</guid>
		<description><![CDATA[Revium are thrilled to announce the launch of the new Tangshan Burak website.
Tangshan Burak is an Australian owned company based in Tangshan, China. Tangshan...


Related posts:<ol><li><a href='http://www.revium.com.au/news/revium-launch-new-autism-victoria-website-www-amaze-org-au/' rel='bookmark' title='Permanent Link: Revium launch new Autism Victoria website,&nbsp;www.amaze.org.au'>Revium launch new Autism Victoria website,&nbsp;www.amaze.org.au</a> <small>Revium invite you to visit the new Autism Victoria website,...</small></li>
<li><a href='http://www.revium.com.au/news/new-aequus-website-goes-live/' rel='bookmark' title='Permanent Link: New Aequus website goes&nbsp;live'>New Aequus website goes&nbsp;live</a> <small>Revium are excited to announce the launch of the new...</small></li>
<li><a href='http://www.revium.com.au/news/pacedg-website-launch/' rel='bookmark' title='Permanent Link: PaceDG Website&nbsp;Launch'>PaceDG Website&nbsp;Launch</a> <small>Last week, Revium were proud to launch a new website...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Revium are thrilled to announce the launch of the new Tangshan Burak website.</p>
<p>Tangshan Burak is an Australian owned company based in Tangshan, China. Tangshan Burak manufactures a complete range of Buffet Fuel, Liquid Wax Cartridges, Table Lamps, The Anywhere Anytime Stove, The Anywhere Anytime Buffet for the Hospitality and Retail Trade.</p>
<p>Revium is about the start SEO for the new website and is looking forward to working with Tangshan Burak on this project.</p>
<p>Make sure you browse their site and tell us what you think!  <a href="http://tangshanburak.com">www.tangshanburak.com</a></p>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/news/revium-launch-new-autism-victoria-website-www-amaze-org-au/' rel='bookmark' title='Permanent Link: Revium launch new Autism Victoria website,&nbsp;www.amaze.org.au'>Revium launch new Autism Victoria website,&nbsp;www.amaze.org.au</a> <small>Revium invite you to visit the new Autism Victoria website,...</small></li>
<li><a href='http://www.revium.com.au/news/new-aequus-website-goes-live/' rel='bookmark' title='Permanent Link: New Aequus website goes&nbsp;live'>New Aequus website goes&nbsp;live</a> <small>Revium are excited to announce the launch of the new...</small></li>
<li><a href='http://www.revium.com.au/news/pacedg-website-launch/' rel='bookmark' title='Permanent Link: PaceDG Website&nbsp;Launch'>PaceDG Website&nbsp;Launch</a> <small>Last week, Revium were proud to launch a new website...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/news/tangshan-buraks-website-overhaul-goes-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Revium launch new Autism Victoria website,&#160;www.amaze.org.au</title>
		<link>http://www.revium.com.au/news/revium-launch-new-autism-victoria-website-www-amaze-org-au/</link>
		<comments>http://www.revium.com.au/news/revium-launch-new-autism-victoria-website-www-amaze-org-au/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 04:30:49 +0000</pubDate>
		<dc:creator>James Fulton</dc:creator>
				<category><![CDATA[Revium News]]></category>
		<category><![CDATA[Amaze]]></category>
		<category><![CDATA[Autism Victoria]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2425</guid>
		<description><![CDATA[Revium invite you to visit the new Autism Victoria website, www.amaze.org.au. The launch of the new website also ties in with the introduction of...


Related posts:<ol><li><a href='http://www.revium.com.au/news/pacedg-website-launch/' rel='bookmark' title='Permanent Link: PaceDG Website&nbsp;Launch'>PaceDG Website&nbsp;Launch</a> <small>Last week, Revium were proud to launch a new website...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/new-products-launch-and-redesign-of-simply-energy-website/' rel='bookmark' title='Permanent Link: New Products Launch and Redesign of Simply Energy&nbsp;website'>New Products Launch and Redesign of Simply Energy&nbsp;website</a> <small>Over the last few weeks the team has been busy...</small></li>
<li><a href='http://www.revium.com.au/news/new-aequus-website-goes-live/' rel='bookmark' title='Permanent Link: New Aequus website goes&nbsp;live'>New Aequus website goes&nbsp;live</a> <small>Revium are excited to announce the launch of the new...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Revium invite you to visit the new Autism Victoria website, <a href="http://www.amaze.org.au" target="_blank">www.amaze.org.au</a>. The launch of the new website also ties in with the introduction of a new logo and corporate name for Autism Victoria, who are now trading as <strong>Amaze</strong>.</p>
<p>After 3 three months of hard work, it gives us great pleasure to launch the new website for Autism Victoria, who are a long standing client of Revium. The new solution is powered by a WordPress CMS and includes features such as a news feed, events calendar and eCommerce to handle donations.</p>
<p>Autism Victoria have had a great relationship with Revium and we look forward to working with them well into the future.</p>
<p>The new Amaze site went live late in September. To view the site please visit <a href="http://www.amaze.org.au" target="_blank">http://www.amaze.org.au</a></p>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/news/pacedg-website-launch/' rel='bookmark' title='Permanent Link: PaceDG Website&nbsp;Launch'>PaceDG Website&nbsp;Launch</a> <small>Last week, Revium were proud to launch a new website...</small></li>
<li><a href='http://www.revium.com.au/articles/blog/new-products-launch-and-redesign-of-simply-energy-website/' rel='bookmark' title='Permanent Link: New Products Launch and Redesign of Simply Energy&nbsp;website'>New Products Launch and Redesign of Simply Energy&nbsp;website</a> <small>Over the last few weeks the team has been busy...</small></li>
<li><a href='http://www.revium.com.au/news/new-aequus-website-goes-live/' rel='bookmark' title='Permanent Link: New Aequus website goes&nbsp;live'>New Aequus website goes&nbsp;live</a> <small>Revium are excited to announce the launch of the new...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/news/revium-launch-new-autism-victoria-website-www-amaze-org-au/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC3 &#8211; Application_Error not firing&#160;log4net</title>
		<link>http://www.revium.com.au/articles/sandbox/asp-net-mvc3-application_error-not-firing-log4net/</link>
		<comments>http://www.revium.com.au/articles/sandbox/asp-net-mvc3-application_error-not-firing-log4net/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 06:11:32 +0000</pubDate>
		<dc:creator>Mark Wiseman</dc:creator>
				<category><![CDATA[Revium Sandbox]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[log4net]]></category>

		<guid isPermaLink="false">http://www.revium.com.au/?p=2413</guid>
		<description><![CDATA[Recently we have started developing a number of MVC3 applications. They have all started to be released to our staging and production servers and...


Related posts:<ol><li><a href='http://www.revium.com.au/articles/sandbox/asp-net-mvc-handleerror-and-logging/' rel='bookmark' title='Permanent Link: ASP.NET MVC [HandleError] and&nbsp;logging'>ASP.NET MVC [HandleError] and&nbsp;logging</a> <small>Recently I&#8217;ve been a bit surprised to find out that...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/fluentsecurity-mvcsitemapprovider-better-net-security-management/' rel='bookmark' title='Permanent Link: FluentSecurity + MvcSiteMapProvider = Better .Net Security&nbsp;Management'>FluentSecurity + MvcSiteMapProvider = Better .Net Security&nbsp;Management</a> <small>In my continual quest for find better ways of doing...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/power-of-the-aspnet-mvc-jquery/' rel='bookmark' title='Permanent Link: Power of the ASP.NET MVC +&nbsp;jquery'>Power of the ASP.NET MVC +&nbsp;jquery</a> <small>What a hectic couple of last months we have had...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Recently we have started developing a number of MVC3 applications. They have all started to be released to our staging and production servers and for some reason we are no longer we are seeing the error emails / log we were whilst developing. After a little investigation it appeared that Application_Error in Golbal.asax was not being fired and we were just seeing a nice friendly error page.</p>
<p><strong>Method that works but isn&#8217;t ideal</strong></p>
<p>Initially is commented out the HandleErrorAttribute filter in Global.asax and added a customError handler with defaultRedirect=&#8221;~/Error&#8221; in our web.config.</p>
<pre class="brush: c-sharp;">public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
   //filters.Add(new HandleErrorAttribute());
}</pre>
<p>This seemed to make everything work ok. But after some consideration i decided this isn&#8217;t ideal because the correct http codes are never sent to the browser. So I decided to dig a little deeper.</p>
<p><strong>So why dosen&#8217;t Application_Error fire?</strong></p>
<p><strong></strong>The best explanation if found for this was on stack overflow: <a href="http://stackoverflow.com/questions/6508415/application-error-not-firing-when-customerrors-on">Application_Error not firing when customerrors = &#8220;On&#8221;</a>. Specifically this excerpt:</p>
<p style="padding-left: 30px;"><em>By default (when a new project is generated), an MVC application has some logic in the Glabal.asax.cs file. This logic is used for mapping routes and registering filters. By default, it only registers one filter: a HandleErrorAttribute filter. When customErrors are on (or through remote requests when it is set to RemoteOnly), the HandleErrorAttribute tells MVC to look for an Error view and it never calls the Application_Error() method. I couldn&#8217;t find documentation of this but it is explained in <a href="http://programmers.stackexchange.com/questions/45195/what-are-the-definitive-guidelines-for-custom-error-handling-in-asp-net-mvc-3/45197#45197">this answer on programmers.stackexchange.com</a>.</em></p>
<p>None of the solutions I saw in that post looked particularly appealing so I looked at how other error logging frameworks were used with MVC3. That is when I came across this solution using ELMAH: <a href="http://ivanz.com/2011/05/08/asp-net-mvc-magical-error-logging-with-elmah/">ASP.NET MVC Magical Error Logging with ELMAH</a>. Specifically Step 4 where they create a class that implements IExceptionFilter.</p>
<p>I just created a similar class that worked with log4net and have been living the logging dream since.<br />
Here is the full solution:</p>
<p><strong>log4netExceptionFilter.cs</strong></p>
<pre class="brush: c-sharp;">using System;
using System.Web.Mvc;

public class log4netExceptionFilter : IExceptionFilter
{
    public void OnException(ExceptionContext context)
    {
        Exception ex = context.Exception;
        if (!(ex is HttpException))	//ignore "file not found"
        {
            Logging.PutError("Unhandled exception error", ex);
        }
    }
}</pre>
<p><strong>Loggin.cs</strong></p>
<pre class="brush: c-sharp;">using System;
using System.Configuration;
using log4net;
using log4net.Config;

public static class Logging
{
    private static readonly ILog Log = LogManager.GetLogger(ConfigurationManager.AppSettings["log4netLogger"]);

    public static void PutError(string message, Exception e)
    {
        Log.Error(message + "; Url: " + HttpContext.Current.Request.Url.AbsoluteUri + "; Error: ", e);
    }

    // Other Custom Logging Functions

}</pre>
<p><strong>Global.asax.cs</strong></p>
<pre class="brush: c-sharp;">public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
    filters.Add(new log4netExceptionFilter()); //must be the first line
    filters.Add(new HandleErrorAttribute());
}</pre>


<p>Related posts:<ol><li><a href='http://www.revium.com.au/articles/sandbox/asp-net-mvc-handleerror-and-logging/' rel='bookmark' title='Permanent Link: ASP.NET MVC [HandleError] and&nbsp;logging'>ASP.NET MVC [HandleError] and&nbsp;logging</a> <small>Recently I&#8217;ve been a bit surprised to find out that...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/fluentsecurity-mvcsitemapprovider-better-net-security-management/' rel='bookmark' title='Permanent Link: FluentSecurity + MvcSiteMapProvider = Better .Net Security&nbsp;Management'>FluentSecurity + MvcSiteMapProvider = Better .Net Security&nbsp;Management</a> <small>In my continual quest for find better ways of doing...</small></li>
<li><a href='http://www.revium.com.au/articles/sandbox/power-of-the-aspnet-mvc-jquery/' rel='bookmark' title='Permanent Link: Power of the ASP.NET MVC +&nbsp;jquery'>Power of the ASP.NET MVC +&nbsp;jquery</a> <small>What a hectic couple of last months we have had...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.revium.com.au/articles/sandbox/asp-net-mvc3-application_error-not-firing-log4net/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

