Monday, December 12, 2011

How to scroll to a div in a long page by Javascript?



            document.getElementById('divID').scrollIntoView();

How to render a view without layout in ASP.NET MVC?


In_ViewStart.cshtml, Check if it is an ajax call. If yes set layout to null
    if (Request.IsAjaxRequest())
    {
        Layout = null;
    }
    else
    {
        Layout = "~/Views/Shared/_Layout.cshtml";
    }

How ASP.NET MVC routing module works

http://www.simple-talk.com/dotnet/.net-framework/asp.net-mvc-routing-extensibility/



routes.MapRoute("BlogArchive",
    "{year}/{month}/{day}",
    new { controller = "Blog", action = "List", month = "1", day = "1" },
    new { year = @"\d{2}|\d{4}", month = @"\d{1,2}", day = @"\d{1,2}" }
    );

Traveling, Writing and Programming

http://alexmaccaw.co.uk/posts/traveling_writing_programming

RTW