Go to the documentation of this file.00001 using System;
00002 using System.Collections;
00003 using System.Web;
00004 using System.Web.Mvc;
00005 using N2.Web.UI;
00006
00007 namespace N2.Web.Mvc
00008 {
00015 [Obsolete("Use System.Web.Mvc.ViewPage<>")]
00016 public class N2ViewPage<TItem> : ViewPage<TItem>, IItemContainer
00017 where TItem : ContentItem
00018 {
00019 #region IItemContainer Members
00020
00021 public TItem CurrentItem
00022 {
00023 get { return Html.ViewData.Model; }
00024 set { Html.ViewData.Model = value; }
00025 }
00026 ContentItem IItemContainer.CurrentItem
00027 {
00028 get { return CurrentItem; }
00029 }
00030
00031 #endregion
00032
00033 public HtmlHelper<TItem> Content { get { return Html; } }
00034
00035 public override void RenderView(ViewContext viewContext)
00036 {
00037 ViewContext = viewContext;
00038 InitHelpers();
00039 ID = Guid.NewGuid().ToString();
00040
00041 var response = new HttpResponse(viewContext.HttpContext.Response.Output);
00042 var context = new HttpContext(HttpContext.Current.Request, response) { User = viewContext.HttpContext.User };
00043 foreach (DictionaryEntry contextItem in viewContext.HttpContext.Items)
00044 {
00045 context.Items[contextItem.Key] = contextItem.Value;
00046 }
00047
00048 ProcessRequest(context);
00049 }
00050 }
00051 }