控制器代码:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using Mvc1.Models;namespace Mvc1.Controllers{ public class HomeController : Controller { public ActionResult Other1() { return View(); } public ActionResult FFF(string one, string two) { int end = Convert.ToInt32(one) + Convert.ToInt32(two); Session["end"] = end; return RedirectToAction("Other1"); } public ActionResult GGG(string one, string two) { int end = Convert.ToInt32(one) - Convert.ToInt32(two); Session["end"] = end; return RedirectToAction("Other1"); } }}
界面代码:
@{ Layout = null;}Other1 @{ if (Session["end"] != null) { @Session["end"].ToString() Session["end"] = null; } }