码迷,mamicode.com
首页 >  
搜索关键字:actionresult    ( 581个结果
MVC之ActionResult
一、所有的Controller都继承自System.Web.Mvc.Controller 目前ASP.NET MVC3默认提供了多种ActionResult的实现,在System.Web.Mvc命名空间里。 其中ActionResult是一个抽象类,所有一下的Result都继承自它,因此如果一个.....
分类:Web程序   时间:2015-01-05 16:24:06    阅读次数:130
asp.net mvc控制器动作体返回ImageResult,可作验证码
public ActionResult Img() { // 获取博客园空间顶部的banner图片 WebRequest req = WebRequest.Create("http://space.cnblogs.com/images/a4/...
分类:Web程序   时间:2015-01-01 11:13:39    阅读次数:166
启用 CORS 来解决这个问题(ajax跨域请求)
1 2 3 4 @section Scripts 5 { 6 7 8 } 9 10 Javascript 1 //独立部署的图片服务器 2 public ActionResult Index() 3 { 4 //if (Request.HttpMethod == ...
分类:Web程序   时间:2014-12-30 18:34:58    阅读次数:1885
MVC学习-发送请求
在HomeControl中添加一个Action,代码如下: public ActionResult Add() { return View(); } 当View()中不写任何参数时,默认会调用同名的视图,添加一个视图Add.cshtml,同时添加一个表单,代码如下: @using (Html.Beg...
分类:Web程序   时间:2014-12-30 01:41:37    阅读次数:310
ASP.NET MVC PartialView用法
子页面AreaSelect.cshtml页面的Controller代码:public ActionResult AreaSelect(){ return PartialView();}父页面前台代码: @{ ViewDataDictionary data = new Vi...
分类:Web程序   时间:2014-12-26 11:07:36    阅读次数:134
EasyUI的datagrid分页
EasyUI的datagrid分页前台代码:View Code后台:public ActionResult TouBiZhaoLingSearch(string startDate, string endDate, int page, int rows){ int totalCount; ...
分类:其他好文   时间:2014-12-20 22:05:41    阅读次数:294
json+mvc
返回JsonResult序列化的Json对象 public class MyController : Controller{ // 必须返回ActionResult类型 public ActionResult HelloWorld() { ViewData["Message"] = "Hello W...
分类:Web程序   时间:2014-12-18 16:54:23    阅读次数:146
ActionResult
MVC 中有许多自定义的 ActionResult,自定义 ActionResult 的方法是继承 ActionResult,如下例:public class XmlResult : ActionResult{ // Properties public XDocument Data { ...
分类:其他好文   时间:2014-12-17 18:01:55    阅读次数:124
ActionResult派生类
类名抽象类父类功能ContentResult 根据内容的类型和编码,数据内容.EmptyResult 空方法.FileResultabstract 写入文件内容,具体的写入方式在派生类中.FileContentResult FileResult通过 文件byte[] 写入文件.FileP...
分类:其他好文   时间:2014-12-12 19:02:07    阅读次数:189
ajax、json一些整理(2)
data是json数据。传递到的Action是/Home/MyAjax。那么在Action方法处接收的方式如下:public ActionResult MyAjax(string val1) { string val2 = Request["val2"].To...
分类:Web程序   时间:2014-12-10 16:15:48    阅读次数:331
581条   上一页 1 ... 45 46 47 48 49 ... 59 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!