62,041
社区成员
发帖
与我相关
我的任务
分享
@model string[]
@{
ViewBag.Title = "Index";
}
这只是一大堆人名,不是名人:
@foreach (string name in Model) {
<span><b>@name</b></span>
}
public class _Page_Views_Home_Index_cshtml : System.Web.Mvc.WebViewPage<string[]>
{
public _Page_Views_Home_Index_cshtml()
{
}
public override void Execute()
{
WriteLiteral("\r\n");
ViewBag.Title = "Index";
WriteLiteral("\r\n这只是一大堆人名,不是名人:\r\n\r\n");
foreach (string name in Model)
{
WriteLiteral(" <span><b>");
Write(name);
WriteLiteral("</b></span>\r\n");
}
}
}
public override void WriteLiteral(object value)
{
Output.Write(value);
}
public interface IViewPageActivator
{
object Create(ControllerContext controllerContext, Type type);
}
public object Create(ControllerContext controllerContext, Type type)
{
try
{
return _resolverThunk().GetService(type) ?? Activator.CreateInstance(type);
}
catch (MissingMethodException exception)
{
// Ensure thrown exception contains the type name. Might be down a few levels.
MissingMethodException replacementException =
TypeHelpers.EnsureDebuggableException(exception, type.FullName);
if (replacementException != null)
{
throw replacementException;
}
throw;
}
}
internal interface IBuildManager
{
bool FileExists(string virtualPath);
Type GetCompiledType(string virtualPath);
ICollection GetReferencedAssemblies();
Stream ReadCachedFile(string fileName);
Stream CreateCachedFile(string fileName);
}
Type IBuildManager.GetCompiledType(string virtualPath)
{
return BuildManager.GetCompiledType(virtualPath);
}