We have usually developed many asp.net applications.But didn't discuss this concepts before.In asp.net, user interaction is structured in the sequence of web pages and handles the event of those pages.But In ASP.NET MVC ,user interaction is structured around the controller and action methods.Here ,the Action methods usually have a one to one mapping with user interaction.
The controller classes are the classes that are mapped by the ASP.NET MVC framework URLs.Here,you will see,the controller classes process the incoming request ,tackle the user input and interactions and finally execute the appropriate application logic.The base class for all the controller in controller class which perform MVC handling concepts.
A controller class invokes the a separate view component to generate the HTML Markup for any incoming request. The controller class uses the Icontroller , IActionFilter and IDisposable interfaces .
A class which is derived from controller class ,performed following actions as given below.
Example:-The controller classes are the classes that are mapped by the ASP.NET MVC framework URLs.Here,you will see,the controller classes process the incoming request ,tackle the user input and interactions and finally execute the appropriate application logic.The base class for all the controller in controller class which perform MVC handling concepts.
A controller class invokes the a separate view component to generate the HTML Markup for any incoming request. The controller class uses the Icontroller , IActionFilter and IDisposable interfaces .
A class which is derived from controller class ,performed following actions as given below.
- It is helpful to locate the appropriate action method to call and validate.
- It is used to set the values as the action method's arguments.
- It is helpful to handling the all errors that occurs during the execution of the action method.
- It provide default web form view factory class for loading ASP.NET Page types.
public class MyfirstController : Controller
{
//
// GET: /Myfirst/
public ActionResult Index()
{
ViewData["title"] = "Welcome to http://www.msdotnet.co.in";
ViewData["Date_Time"] = DateTime.Now.ToString();
return View();
}
Description:-
- Here simple,I have created a Myfirst controller class .
- Here In this class, Index () is an Action.
- Any body calls the Myfirst controller class then it first call Index() function.
- This Index () Function return a view Object.
- After that, this view is translated in ActionResult .
- After that,this ActionResult will be displayed on the Browser. Which will be visible to every clients.
For More...
- How to implement data binding concepts in WPF application
- How to implement role based security in asp.net application
- Namespaces in WPF Application
- How to implement 3tier architure concepts in asp.net application
- How to implement polymorphism concepts in c#
- C# advanced interview questions and answers
0 comments:
Post a Comment