forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewPage`1.cs
More file actions
47 lines (41 loc) · 1.26 KB
/
ViewPage`1.cs
File metadata and controls
47 lines (41 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using ServiceStack.Html;
using ServiceStack.Razor.Templating;
using ServiceStack.ServiceHost;
namespace ServiceStack.Razor
{
public abstract class ViewPage<TModel> : ViewPageBase<TModel>
{
public HtmlHelper<TModel> Html = new HtmlHelper<TModel>();
private IViewEngine viewEngine;
public override IViewEngine ViewEngine
{
get { return viewEngine; }
set
{
Html.ViewEngine = viewEngine = value;
}
}
protected ViewPage()
{
this.ScopeArgs = new Dictionary<string, object>();
}
public override Type ModelType
{
get { return typeof(TModel); }
}
public override void Init(IRazorViewEngine viewEngine, ViewDataDictionary viewData, IHttpRequest httpReq, IHttpResponse httpRes)
{
this.Request = httpReq;
this.Response = httpRes;
Html.Init(httpReq, viewEngine, viewData);
this.Model = (TModel) viewData.Model;
}
public virtual bool IsSectionDefined(string sectionName)
{
//return this.childSections.ContainsKey(sectionName);
return false;
}
}
}