我看到了
.aspx
这个
SIGAMVC。型号。德塔勒
是由框架生成的,我不应该碰它
我找到了一个解决方案,但它不起作用
here
看法
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SIGAMVC.Models.Detalle>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h4><b><%:Session["TEST"] %></b></h4> <%-- i tried por session but not found --%>
<h1><%=MyValue%></h1> <%-- too --%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MenuContent" runat="server">
</asp:Content>
控制器
protected string MyValue { get; set; }
[HttpPost]
public ActionResult Create(Detalle detalle, int id)
{
Session["TEST"] = "RODRIGO ALEX";
this.MyValue = "Some Value";
return View(detalle);
}