In Asp.net Explain the request flow in ASP.NET MVC framework

Asp.net : Explain the request flow in ASP.NET MVC framework:


In this tutorial we consider many examples related to Introduction of Asp.net grid view Control.,Example of Templatefield in gridview .,Example of DropDownList inside GridView,Check box in ASP.NET GridView,Ckeck box list example using javascript in grid.,Check box in ASP.NET GridView,Show grid view row details in to tooltip.How to Bind Gridview Form database.,Show gridview Row Details And Give Example.,Example of Templatefield in asp.net gridview.,Example of DropDownList inside GridView control,Introduction of Asp.net grid view Control.,Example of C# for Bind Data to asp.net Textbox inside gridview control,Bind Data to asp.net textbox control in inside of gridview Using C# Example,How to create master page in asp net c#,ASP .NET Read a text file by C#,Create Dynamic Rows in ASP.Net GridView Control with TextBoxes,Adding Dynamic Rows in ASP.Net GridView Control with Textbox,Create ASPX Page in ASP.Net and C#,Cookies,how to make Cookies in asp.net with C#.

Application Request flow for ASP.NET MVC framework is as follows:
Request hits the controller coming from client. Controller plays its role and decides which model to use in order to serve the request. Further passing that model to view which then transforms the model and generate an appropriate response that is rendered to client.




What is the difference between ViewData, ViewBag and TempData?

In order to pass data from controller to view and in next subsequent request, ASP.NET MVC framework provides different options i.e. ViewData, ViewBag and TempData.
Both ViewBag and ViewData are used to to communicate between controller and corresponding view. But this communication is only for server call, it becomes null if redirect occurs. So, in short, its a mechanism to maintain state between controller and corresponding view. ViewData is a dictionary object while ViewBagis a dynamic property (a new C# 4.0 feature). ViewData being a dictionary object is accessible using strings as keys and also requires typecasting for complex types. On the other hand, ViewBag doesn’t have typecasting and null checks.
TempData is also a dictionary object that stays for the time of an HTTP Request. So, Tempdata can be used to maintain data between redirects i.e from one controller to the other controller.

Other Asp.net Related post :















Comments

Popular posts from this blog