State management techniques ASP .NET MVC 2 - asp.net-mvc-2

I am new to ASP.NET MVC and have worked in ASP.NET before. I am starting a new project in ASP.NET MVC 2 and wanted to find out what all state management techniques are available in ASP.NET MVC 2.
Can anyone please suggest some good resource.
Thanks.

You can use Session just as in ASP.NET WebForms. Was there anything else you wondered? You don't have ViewState as in WebForms, but you can use ViewDatato pass data between controllers and views (see e.g. http://msdn.microsoft.com/en-us/library/dd394711.aspx). What kind of state are you planning to manage?

For state management you can use Session, but to do it the MVC way, you should combine it with action filters.
Here are some links that can help you:
ASP.NET MVC Filters and Statefulness
mvcConf 2 - Brad Wilson: Advanced MVC 3

Related

asp.net mvc page lifecycle event

Currently we are migrating an existing asp.net web application to asp.net mvc 2 platform. All of our pages performs some business functionality before loading the page or initializing the page. How to achieve this similar behavior in asp.net mvc
The logic which we have currently in pagebase class for web app like this..
if (!Page.IsPostBack)
// Presenter.PerformStartUp()
Please help.
Thanks
Subu
ASP.NET MVC is a totally different pattern than what you might have been used in classic WebForms. There are no events in MVC. The are no pages in MVC. There is notion of PostBack in MVC. There is no ViewState in MVC. There are no server side controls in MVC.
In MVC you have a Controller which receives the user request, it manipulates the Model and passes a view model to the View for displaying. A good starting point is here: http://asp.net/mvc
If the existing application you are trying to migrate has been written properly and it has a service layer and a data access layer at best you could reuse those parts into the new ASP.NET MVC application.
In asp.net mvc you create ActionResult methods by decorating them with the attribute [HttpPost] and [HttpGet](HttpGet is default) this is what sepparates between a Get and Post.

Using FoxCop 1.36 with ASP.NET MVC Project

I am developing an application in ASP.NET MVC 2. I would like to use FoxCop 1.36. Is there a way to use the foxcop for ASP.NET MVC Projects. If possible, kindly let me know the procedures.

web parts in asp.net mvc

This might be the most trivial question asked, but I raise it again. Am planning to get started with asp.net MVC on a personal project and here am struck if it supports webparts or any other alternative to it is present. I intend to have a start page similar to igoogle or pageflakes, but my initial research pointed out that as there's no ViewState nor Postback concepts in ASP.NET MVC implementing web parts is not possible.
If that is the case, are there any resources which helps in building a start page as the one i wish to using MVC.
PS: Links I found in the initial research
Quick tips on asp.net MVC -
webparts framework
Building widgets using jquery in
asp.net MVC
You should use AJAX to create widgets that can interact with the server without reloading the page.
This way, the widgets will not affect each-other.
jQuery will be useful here.
Alternatively, you could put each widget in its own <iframe>.

Is ASP.NET MVC a Good Fit for an Event Ticketing Site?

Good Afternoon,
I'm rebuilding an event ticketing site originally developed using ASP.NET 3.5 WebForms and am considering using ASP.NET MVC2 for the rebuilt solution. I like the idea of friendly URLs as the current site has very long query string URLs for each specified event. MVC2 also appeals from a separation of concerns point of view as well. The biggest unknown for me is will MVC2 handle calls to 3 separate web services (SOAP and REST) to get ticket availability? That is, does the controller functionality permit use of such web services? Finally, MVC3 is due to RTM in January. Am I better off waiting for MVC3, or can I start the project in MVC2 and port it later?
Thanks for all your advice and insight.
MVC can handle any HTTP request as ASP.NET forms does. Indeed you should consider to use WCF for handling SOAP queries. And yes, sure you can easely create REST API with MVC.
It is better to start now, with ASP.NET MVC 3 RC2. It is very stable and nice. This will minimize migration work. Welcome to MVC happy world!
The controller will let you run pretty much any code you want.
I just started using MVC in a big project and it's turning out well. We went with MVC 3 and it's been a little tricky living on the edge, but it seems to have a lot of nice improvements. I'm extremely happy to be using MVC instead of Web Forms. To me, it seems to flow smoothly instead of fighting with the way the web works.

Is there a MVC SiteMap Provider that supports ASP.NET MVC 2 Areas feature?

I am looking for a MVC SiteMap provider in which I can specify area as well, along with controller and action. Did anyone use a SiteMap provider that supports MVC 2 Areas ?
I haven't used it but there is an mvcsitemap project on codeplex which appears to handle areas, and has good reviews.