MVC ASPX(webForm)视图引擎 <%:%> 与<%=%>的差别
控制器
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MvcApplication2.Controllers { public class HomeController : Controller { // // GET: /Home/ public ActionResult Index() { ViewData["Script"] = "<script>alert('Dome')</script>"; return View(); } } }
视图