*最普通的交互方式,在Contoller中的Action方法内 public ActionResult Index() { ViewData["Key"] =Value; Return View(); } *对应Action的前台页面,在前台的Index.aspx中,即可使用<%=ViewData[ ...
分类:
Web程序 时间:
2017-06-09 14:11:03
阅读次数:
221
<a href='~/Download?filePath=路径" > 下载 </a> public ActionResult Download(string filePath) //文件绝对路径 { return File(filePath, "application/octet-stream", ...
分类:
Web程序 时间:
2017-06-08 18:55:47
阅读次数:
261
首先在需要分页的table 下引入这行代码(引入已经准备好的通用分页) @Html.Partial("~/Views/Shared/_Pagination.js.cshtml",ViewData) 只需要在控制器设置两个参数 public ActionResult ProjectNode(strin ...
分类:
其他好文 时间:
2017-06-07 18:42:57
阅读次数:
261
public ActionResult SecurityCode() { string oldcode = TempData["SecurityCode"] as string; string code = CreateRandomCode(4); //验证码的字符为4个 TempData["Sec ...
public class HomeController : Controller { public ActionResult Index() { //return View(); //return RedirectToAction("Login", "Auth", new { Area = "Acc... ...
分类:
Web程序 时间:
2017-05-25 19:47:29
阅读次数:
222
[HttpPost] public ActionResult UpFile() { int count = Request.Files.Count; for (int i = 0; i < count; i++) { WebTest.Entity.FileInfo fileInfo = new We ...
分类:
Web程序 时间:
2017-05-25 01:22:37
阅读次数:
199
public ActionResult GetTreeJson() { List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>(); var list = bpDAL.GetList(o => o.Tr ...
分类:
其他好文 时间:
2017-05-25 01:18:58
阅读次数:
243
实现类CommonResponseHandler ActionResult类里面用到的JsonUtils 里面的main方法为测试 ActionResult里面用到的MsgUtils ...
分类:
编程语言 时间:
2017-05-22 13:43:31
阅读次数:
283
控制器里的代码如下: private MySqlDbHelper msh = new MySqlDbHelper(); public ActionResult Index() { string sql = "select * from deviceType"; DataTable dt = msh. ...
分类:
Web程序 时间:
2017-05-20 21:52:38
阅读次数:
240
基本流程图 注册页面就不再写出,现在将发送邮件的代码粘贴出来 public ActionResult SendEmial() { int customerID= 1; string validataCode = System.Guid.NewGuid().ToString(); try { Syst ...
分类:
Web程序 时间:
2017-05-12 16:33:37
阅读次数:
182