ARTICLE

How to Add controller in ASP.NET MVC3 in VB.NET

Posted by Rohatash Kumar Articles | ASP.NET using VB.NET April 11, 2011
This article defines the Add controller in ASP.NET MVC3 in VB.NET.
 
Reader Level:

This article defines the Add controller in ASP.NET MVC in VB.NET.

The MVC framework has three components.

Model

Model objects are the parts of the application that implement the logic for the applications domain. For example, a  object might retrieve information from a database, operate on it, and then write updated information back to a table in SQL Server.

View

Views are the components that display the application user interface (UI).

MVC stands for model-view-controller. MVC is a pattern for developing applications such that each part has a separate responsibility.

controller

This component handles user interaction. It controls user input to display information on View from Model.

Adding controller

Step-1

Now adding ASP.NET MVC Web Application by using view ->solution Explorer  ASP.NET MVC web Application.

add1.gif

Figure1.gif

Step-2

Now right click on the solution explorer and add the controller.

Solution explorer->controllers->right-click->add->controller.

add2.gif

Figure2.gif

Step-3

Name your new controller RohatashController and click Add.

add4.gif

Figure3.gif

Step-4

Notice in Solution Explorer that a new file has been created named Controller.cs. The file is open in the IDE.

add3.gif

Figure4.gif

Step-5

Now creating a function Index.

add5.gif

Figure5.gif

Step-6

Run the application (press F5 or Ctrl+F5). In the browser, append Rohatash to the path in the address bar. for example http://localhost:2858/Rohatash

add6.gif

Figure6.gif

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Nevron Diagram
Become a Sponsor