2 changed files with 75 additions and 0 deletions
@ -0,0 +1,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 |
||||||
|
#> |
||||||
Loading…
Reference in new issue