MVC笔记 Controller相关技术
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.IO;
namespace DemoRC.Controlle...
分类:
其他好文 时间:
2014-09-23 23:04:15
阅读次数:
179
public ActionResult GetTreeData() { DirectoryInfo dir = new DirectoryInfo("d://"); Dir dirList = GetTreeJson(dir);...
分类:
其他好文 时间:
2014-09-22 20:48:03
阅读次数:
207
最近在开发项目中,使用的是ASP.NET MVC
由于之前并没有接触,对于它的传值方式有些陌生,在这里进行初步总结积累学习!
一:使用
ViewData使用:
public ActionResult Index()
{
List colors = new List();
colors.Add("red");
colors.Add("green");
colors.Add...
分类:
Web程序 时间:
2014-09-18 20:44:04
阅读次数:
241
1.读取20条最新留言public ActionResult Index(){ var mostRecentEntries = (from entry in _db.Entries orderby entry.DateAdded desc...
分类:
其他好文 时间:
2014-09-16 15:35:10
阅读次数:
221
#region 首页 public ActionResult Index() { string User_Test_Select = "User_Test_Select"; var item = DBhelp.G...
分类:
Web程序 时间:
2014-09-15 15:53:59
阅读次数:
231
本例中,我们尝试把javascript程序搬至控制器中去。更好地在控制器编写程序。首先来看看原来的写法。在SepController控制器,添加如下操作: public ActionResult ExerciseA() { return View(); ...
分类:
编程语言 时间:
2014-09-08 00:58:46
阅读次数:
310
典型的文件上传表单 文件上传操作public ActionResult Index(HttpPostedFileBase file)if (file != null){ string strpath = Server.MapPath("~/files/"+ file.FileName); //获.....
分类:
Web程序 时间:
2014-09-05 14:11:51
阅读次数:
195
在mvc中所有的controller类都必须使用"Controller"后缀来命名并且对Action也有一定的要求:必须是一个public方法必须是实例方法没有标志NonActionAttribute特性的(NoAction)不能被重载必须返回ActionResult类型下面列举Asp.net MV...
分类:
其他好文 时间:
2014-09-04 18:34:59
阅读次数:
206
断点调试发现报错的语句为:public ActionResult SomeMethod(string someId){ var temp = SomeService.LoadEntities(a => a.ID == int.Parse(someId));}原因是:在Lambda表达式内部不能实现数...
分类:
其他好文 时间:
2014-09-02 17:17:54
阅读次数:
369
RDLC报表使用方便,能很好镶嵌在web程序里面,且能方便的导出各种文件的格式;使用此报表程序要引用 Microsoft.Reporting.WebForms;下面以一个例子来进行讲解它的用法。1.后台代码: #region 报表 public ActionResult ReportV...
分类:
Web程序 时间:
2014-09-02 15:33:34
阅读次数:
421