我無法向您顯示完整的來源。不是我的表演。但我可以告訴你這個。這是我們使用WebForm母版頁渲染剃鬚刀視圖的一部分。
--- --- razorview.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<% Html.RenderPartial((string) ViewBag._ViewName); %>
</asp:Content>
<asp:Content ID="scriptContent" ContentPlaceHolderID="ScriptContent" runat="server">
</asp:Content>
--- ---使用
public ActionResult Create(int clientId)
{
....
return this.RazorView(choices);
---的Site.Master(刪節)---
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<%@ Import Namespace="...." %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Some Alt</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="../../Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="ScriptContent" runat="server" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
</head>
<body>
<div class="page">
<div id="main">
<table width="100%">
<tr>
<td valign="top" width="150" height="50">
<img src="<%= Common.CompanyLogoPath%>" alt="Some Alt width="150"
height="50" />
</td>
<td align="left" width="630" height="50" class="mainheading">
Description
</td>
<td align="right" valign="bottom">
<%= DateTime.Now.FormatShortDate() %>
</td>
</tr>
<tr>
<td colspan="3">
<hr />
</td>
</tr>
<tr>
<td valign="top" class="rightBorder">
<table>
.....
</table>
</div>
</div>
</body>
</html>
爲什麼投票下來? – ivowiblo
可能因爲原來的標題是絕對可怕的。 –
它更容易修復它... – ivowiblo