第1个回答 2013-07-15
我用的MVC2可以这样操作,你试试吧。Submit.aspx写入字符串,跳转到Index.aspx显示出来;。。。。。。。。。。。。。。。。。 public ActionResult Index(string name)
{
TempData["name"] = name;
return View();
}
public ActionResult Submit()
{
return View();
}。。。。。。。。。。。。。。。。。 <h2>Index</h2>
<%=Html.TextBox("name",TempData["name"])%>。。。。。。。。。。。。。。。。。。 <h2>Submit</h2>
<% using (Html.BeginForm("Index","Test",FormMethod.Post)) { %>
<%:Html.TextBox("name") %>
<input type="submit" value="登录" />
<% } %>
第2个回答 推荐于2018-03-29
Submit.aspx写入字符串,跳转到Index.aspx显示出来;。。。。。。。。。。。。。。。。。 public ActionResult Index(string name)
{
TempData["name"] = name;
return View();
}
public ActionResult Submit()
{
return View();
}。。。。。。。。。。。。。。。。。 <h2>Index</h2>
<%=Html.TextBox("name",TempData["name"])%>。。。。。。。。。。。。。。。。。。 <h2>Submit</h2>
<% using (Html.BeginForm("Index","Test",FormMethod.Post)) { %>
<%:Html.TextBox("name") %>
<input type="submit" value="登录" />
<% } %>本回答被网友采纳