This repository has been archived by the owner on Oct 16, 2020. It is now read-only.
/
Create.tt
72 lines (66 loc) · 1.75 KB
/
Create.tt
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<#@ template language="VB" HostSpecific="true" #>
<#@ import namespace="ICSharpCode.AspNet.Mvc" #>
<#@ import namespace="Microsoft.VisualBasic.Constants" #>
<# If MvcHost.IsPartialView Then #>
<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl<#= GetViewPageType() #>" %>
<# ElseIf MvcHost.IsContentPage Then #>
<%@ Page Language="VB" MasterPageFile="<#= MvcHost.MasterPageFile #>" Inherits="System.Web.Mvc.ViewPage<#= GetViewPageType() #>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Title" runat="server">
<#= MvcHost.ViewName #>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="<#= MvcHost.PrimaryContentPlaceHolderID #>" runat="server">
<#
PushIndent(vbTab)
Else
#>
<%@ Page Language="VB" Inherits="System.Web.Mvc.ViewPage<#= GetViewPageType() #>" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title><#= MvcHost.ViewName #></title>
</head>
<body>
<#
PushIndent(vbTab & vbTab)
End If
#>
<% Using Html.BeginForm() %>
<%: Html.ValidationSummary(True) %>
<fieldset>
<legend><#= MvcHost.ViewDataType.Name #></legend>
<p>
<input type="submit" value="Create"/>
</p>
</fieldset>
<% End Using %>
<div>
<%: Html.ActionLink("Back", "Index") %>
</div>
<#
If MvcHost.IsPartialView Then
' Do nothing.
ElseIf MvcHost.IsContentPage Then
PopIndent()
#>
</asp:Content>
<#
Else
PopIndent()
#>
</body>
</html>
<# End If #>
<#+
ReadOnly Property MvcHost As MvcTextTemplateHost
Get
Return DirectCast(Host, MvcTextTemplateHost)
End Get
End Property
Public Function GetViewPageType() As String
Dim viewDataTypeName As String = MvcHost.ViewDataTypeName
If Not String.IsNullOrEmpty(viewDataTypeName) Then
Return String.Format("(Of {0})", viewDataTypeName)
End If
Return String.Empty
End Function
#>