MVC索引
本帖最后由 a102470 于 2013-04-23 18:41:20 编辑
下面的语句写在Borrow的控制器中,点击链接后,其他的可以传到值,而下面这个不行,反而会firbug调试显示链接到另外一个控制器中去了,当然是链接不到的,求解决方法
[HttpPost]
public JsonResult Location()
{
var dal = new DevLog.DAL.Archives_LocationDAL();
string CompanyID = Session["CompanyID"] as string;
var ls = dal.GetList(CompanyID);
var ll = new List<Locations>();
foreach (DataRow dr in ls.Rows)
{
var l = new Locations()
{
//id=dr["id"].ToString(),
// CompanyID = dr["CompanyID"].ToString(),
Location = dr["Location"].ToString(),
};
ll.Add(l);
}
return this.Json(ll);
}
private class Locations
{
//public string id {get;set;}
//public string CompanyID{get;set;}
public string Location { get; set; }
}
MVC
------解决方案--------------------控制器丢出异常了。用try catch输出下