Archives

Archives / 2012 / March
  • Visual Studio 11 - Getting Started Part 2

    In the previous post, we got a quick start into Visual Studio 11 and checked out the web templates associated with Asp.Net MVC4 and some cool new features. In this post we will look into one of the most useful and intriguing features of Visual Studio 11 - Page Inspector.

    To be honest, Page Inspector beats anything on the lines of dom-visualization as well as server-side code visualization in the development world. According to MSDN - "Page Inspector is a tool that renders a web page (HTML, Web Forms, ASP.NET MVC, or Web Pages) directly within the Visual Studio IDE and lets you examine both the source code and the resulting output. For ASP.NET pages, Page Inspector lets you determine which server-side code has produced the HTML markup that is rendered to the browser. Page Inspector works even when the default ASP.NET bundling and minification features are enabled."

    NOTE: I am using the Single Page Application (SPA) template to demonstrate the funcitonality of Page Inspector. If you are planning on following the code below, please go to Visual Studio 11 and create a new project with SPA template.

    How to use Page Inspector:

    • Open Page Inspector: Right - click on your web application and select View in Page Inspector (screenshot below). Page inspector works on the current version of IE installed on your machine. In my case, I am still using IE 9 and this works for me.

     

  • Visual Studio 11 - Getting Started

    Visual Studio 11 comes with a set of cool features for web developers. This series is focused on but not limited to additions in VS tools for web developers. When you open VS 11 you just can't ignore the new Monochrome-feel. As web developers the first thing you'll notice would be the additions of new templates.

    Let's just go to File -> New Project and then click Visual C# (inside Templates) -> Asp.Net MVC4 application. You will find 5 templates (apart from the Empty template) which are described below:

    • Internet Application: Gives you an Mvc4 project with an account controller that uses forms authentication.
    • Intranet Application: Gives you an Mvc4 project which uses windows authentication.
    • Mobile Application: Newest addition. Yes, you can create cross-browser mobile applications in Mvc4 (details later). This also comes with an account controller that uses forms authentication
    • Web API: Again a new feature that let's you create Restful (Http-based) API. Hint: Won't have to use Wcf Restful API anymore if you are only planning on using this code for web applications. Wcf, though, will still make sense in applications where you can have a combination of different thick and thin clients making requests through a services-layer.
    • Single page application: Think of a scenario where you want to use HTML5, Javascript, CSS3 and Ajax to create a Single Page Web application giving the user the look and feel of a desktop application on the browser. This is a new template that helps you do that.(details later)

    You can create a Unit Test project if you want to, otherwise, you can go ahead and hit OK. Without getting into the details of the template type I selected, let's talk about the new features. These are some features that are evidently new and cannot be missed by the human eye.