.net MVC方面可以咨询我
mvc吧
全部回复
仅看楼主
level 9
长期在线
2016年09月17日 12点09分 1
level 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcGod.Models;
using Webdiyer.WebControls.Mvc;
namespace MvcGod.Controllers
{
public class ProductsController : Controller
{
//
// GET: /God/
private NORTHWNDEntities ne = new NORTHWNDEntities();
public ActionResult Index(int? pageIndex)
{
ViewBag.productCategory = new SelectList(ne.Categories.ToList(), "CategoryID", "CategoryName");这里说不能OPen,我都不知道那里有问题,软件上都没提示那里出现错误
PagedList<Products> pl = new PagedList<Products>(ne.Products.ToList(), pageIndex ?? 1, 5);
return View(pl);
}
public ActionResult Search(string pname,int? productCategory,int? pageIndex)
{
ViewBag.productCategory = new SelectList(ne.Categories.ToList(), "CategoryID", "CategoryName");
// pname = pname.Trim();
var plist = from p in ne.Products
//where p.ProductName.Contains(pname)
select p;
if (!String.IsNullOrEmpty(pname))
{
pname = pname.Trim();
plist =from p in ne.Products
where p.ProductName.Contains(pname)
select p ;
}
if (productCategory != null)
plist = from p in plist
where p.CategoryID == productCategory
select p;
PagedList<Products> pl = new PagedList<Products>(plist.ToList(),pageIndex ?? 1,5);
return View ("Index",pl);
}
}
}
2016年09月20日 08点09分 3
level 9
正在使用
2016年10月19日 13点10分 5
level 9
主要是
2016年10月21日 07点10分 6
level 1
求教程视频。。。webform做了4年 现在转mvc
2016年10月22日 03点10分 7
level 1
我的哥,跪求一份代码,可以实现数据的查加删改。
2016年10月23日 11点10分 9
Q748179390
2016年10月23日 13点10分
level 1
sir,@HTML.textbox()产生的控件如何用js赋值
2016年10月24日 08点10分 10
跟静态页面一样
2016年10月24日 08点10分
level 1
楼主你好。我按照第一张截图新建mvc项目时,点击确认按钮后,就出现第二张截图上的信息,点击确定后返回新建项目的界面了。我用的是vs2013,之前卸载国一个vs2013英文版的,
请问这是什么原因。望解答。跪谢。
2016年10月24日 14点10分 11
level 3
怎么获取select中所有的文本值?求解决
2016年10月30日 10点10分 12
js获取
2016年10月30日 11点10分
回复 羽子love :怎么获取?
2016年10月30日 15点10分
level 1
亲,有mvc的视频吗
2016年10月30日 10点10分 13
level 3
如何将select的文本值传到action里接收?
2016年10月30日 15点10分 14
表单提交或者ajax提交
2016年10月30日 23点10分
如何表单提交
2016年10月31日 04点10分
@fxhdshb ...
2016年10月31日 05点10分
<form id="form" method="post" action="/Control/Save"> 方法1
2017年02月16日 07点02分
level 9
替我
2016年11月05日 04点11分 15
level 9

2016年11月22日 07点11分 16
level 9
同学
2016年11月24日 13点11分 17
level 2
求详细点的MVC+EF实现增删改查的教程。[委屈]
2016年11月25日 08点11分 18
没有教程 有的是我的经验
2016年11月25日 08点11分
1 2 3 尾页