码迷,mamicode.com
首页 >  
搜索关键字:actionresult    ( 581个结果
学习笔记24_MVC前后台数据交互
*最普通的交互方式,在Contoller中的Action方法内 public ActionResult Index() { ViewData["Key"] =Value; Return View(); } *对应Action的前台页面,在前台的Index.aspx中,即可使用<%=ViewData[ ...
分类:Web程序   时间:2017-06-09 14:11:03    阅读次数:221
asp.net Mvc实现文件下载
<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
C#实现登陆验证码图片的动态生成
public ActionResult SecurityCode() { string oldcode = TempData["SecurityCode"] as string; string code = CreateRandomCode(4); //验证码的字符为4个 TempData["Sec ...
分类:Windows程序   时间:2017-05-27 12:11:40    阅读次数:217
MVC项目中怎么浏览html页面
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
Tree数据格式 Easyui
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
java发送http的get、post请求
实现类CommonResponseHandler ActionResult类里面用到的JsonUtils 里面的main方法为测试 ActionResult里面用到的MsgUtils ...
分类:编程语言   时间:2017-05-22 13:43:31    阅读次数:283
返回值为DataTable的数据,在MVC视图里的用法
控制器里的代码如下: private MySqlDbHelper msh = new MySqlDbHelper(); public ActionResult Index() { string sql = "select * from deviceType"; DataTable dt = msh. ...
分类:Web程序   时间:2017-05-20 21:52:38    阅读次数:240
asp.net mvc 注册中的邮箱激活功能实现
基本流程图 注册页面就不再写出,现在将发送邮件的代码粘贴出来 public ActionResult SendEmial() { int customerID= 1; string validataCode = System.Guid.NewGuid().ToString(); try { Syst ...
分类:Web程序   时间:2017-05-12 16:33:37    阅读次数:182
581条   上一页 1 ... 13 14 15 16 17 ... 59 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!