Skip to content

ogaudefroy/TempDataForWebForms

Repository files navigation

TempDataForWebForms

A simple library to provide ASP.Net MVC TempData like support in WebForms pages.

Build status NuGet version

This component might help you when mixin ASP.Net WebForms navigation flow with ASP.Net MVC navigation flow in the same application.

Implementation is made with a custom HTTP Module implementing as following:

  • On PostMapRequestHandler fills the HttpContext.Items[HttpModule.KeyTempDataItems] with the tempdata loaded from the tempdata provider.
  • On EndRequest clears tempdata if not in a redirection process.

ITempDataProvider implementation is resolved with ASP.Net MVC DependencyResolver with the following behavior:

Typical use case: flash messages.