Pages

Showing posts with label MVC. Show all posts
Showing posts with label MVC. Show all posts

Monday, May 19, 2014

How to determine what version of asp.net MVC is being used by an existing mvc application

There are 2 ways to do this

1. At design time - In the solution explorer, expand "References" folder. Right click on System.Web.Mvc assembly and select "Properties" and you can find the version that's used as shown below.

 

2. At runtime using code - typeof(Controller).Assembly.GetName().Version.ToString(); 
Friends, If you like this post, please share with your friends on Facebook and Google+ and recommend us on Google using the g+1 button on the top right hand corner.

How to add MVC5 to Visual Studio 2013 ?

1. Start by installing and running Visual Studio Express 2013 for Web.

2. Visual Studio is an IDE, or integrated development environment. Just like you use Microsoft Word to write documents, you'll use an IDE to create applications. In Visual Studio there's a toolbar along the top showing various options available to you. There's also a menu that provides another way to perform tasks in the IDE. (For example, instead of selecting New Project from the Start page, you can use the menu and select File > New Project.)


Creating Your First Application

3. Click New Project, then select Visual C# on the left, then Web and then select ASP.NET  Web Application. Name your project "MvcMovie" and then click OK.



4. In the New ASP.NET Project dialog, click MVC and then click OK.
5. Visual Studio used a default template for the ASP.NET MVC project you just created, so you have a working application right now without doing anything! This is a simple "Hello World!" project, and it's a good place to start your application.

6. Click F5 to start debugging. F5 causes Visual Studio to start IIS Express and run your web app. Visual Studio then launches a browser and opens the application's home page. Notice that the address bar of the browser sayslocalhost:port# and not something like example.com. That's because localhost always points to your own local computer, which in this case is running the application you just built. When Visual Studio runs a web project, a random port is used for the web server. In the image below, the port number is 1234. When you run the application, you'll see a different port number.

7. Right out of the box this default template gives you  Home, Contact and About pages. The image above doesn't show the Home, About and Contact links. Depending on the size of your browser window, you might need to click the navigation icon to see these links.


  
Friends, If you like this post, please share with your friends on Facebook and Google+ and recommend us on Google using the g+1 button on the top right hand corner.

Creating ASP.NET Web Projects in Visual Studio 2013


  1. Click New Project in the Start page or in the File menu.
  2. In the New Project dialog, click Web in the left pane and ASP.NET Web Application in the middle pane.
  3. Specify project Name, Location, and other options, and then click OK.
    The New ASP.NET Project dialog appears.
  4. Click a template.
  5. If you want to add support for additional frameworks not included in the template, click the appropriate check box. (In the example shown, you could add MVC and/or Web API to a Web Forms project.)
  6. If you want to add a unit test project, click Add unit tests.
  7. If you want a different authentication method than what the template provides by default, click Change Authentication.
    Friends, If you like this post, please share with your friends on Facebook and Google+ and recommend us on Google using the g+1 button on the top right hand corner.

INSTALLATION ASP.NET MVC5 within Visual Studio 2012

It’s always nice to be using the latest and greatest of things, however not everyone really enjoys “change” (especially with regard to their development environments).
So this quick article will cover how to go about creating and using ASP.NET MVC5 applications within Visual Studio 2012 for those out there that want to keep up with the newest version of their favorite development technology but may not have the courage (or the cash) to upgrade to Visual Studio 2013.
Visual Studio 2012 by default will not offer you the option to create an MVC5 Web Application.
In November of this year, the .NET team released the ASP.NET and Web Tools 2013.1 Update for Visual Studio 2012. I wish I could say the steps necessary to integrate MVC5 into Visual Studio 2012 were more complicated than simply downloading this, but they aren’t.
You can download the update itself from the link provided below:
You’ll find that after installing the update and restarting Visual Studio 2012, you’ll be able to create a new ASP.NET MVC5 application through Visual Studio 2012 :
After installing the update, you’ll see that MVC5 is now available in Visual Studio 2012.

Great! What Else?

The update not only provides the necessary foundation for creating MVC5 applications, but it features the following additional improvements as well:
  • Bootstrap Integration – All MVC5 applications and application templates by default will have their markup “bootstrap-ified” using Twitter Bootstrap (which is integrated into the applications by default).
  • Web API 2 Templates – The latest version of Web API template isn’t going to be left out either. You’ll be able to create new Web API services just like MVC5 applications.
  • Entity Framework 6 – Entity Framework 6 will be installed and included within this update and will be used for all of the scaffolding operations in Web API or MVC5.
  • Improved Scaffolding - This improved scaffolding functions as a code generation framework for ASP.NET Web applications. It makes it easy to add boilerplate code to your project that interacts with a data model and will ensure that any items added through scaffolding will have all of the necessary dependencies (packages, references, etc.).
  • Razor Editor Improvements – You’ll find that the toolkit has a variety of improvements and supports the Razor 3 engine.
  • New NuGet – This update also includes the latest version of NuGet 2.7, which removes some of the need for manually restoring packages that go missing and also ensuring that all of your packages are up to date.
So if you are a bit hesitant to give Visual Studio 2013 a try, but you want to play around with some of the newer features and development templates that it provides, I would recommend downloading and checking out this update.
Friends, If you like this post, please share with your friends on Facebook and Google+ and recommend us on Google using the g+1 button on the top right hand corner.