MVC 跳转页面问题
publicActionResultIndex(stringsearchString){varcontainer=newWeiqiEntities();if(!Strin...
public ActionResult Index(string searchString)
{
var container = new WeiqiEntities();
if (!String.IsNullOrEmpty(searchString))
{
//var list =container.Sheng.Where(p => p.ShengName == searchString;
var shengid =(from tit in container.Sheng
where tit.ShengName == searchString
select new {tit.ID}).ToList();
//int shengid = int.Parse(list.ToString());
//现在想要根据这个shengid来跳转页面
//跳转语句怎么写
这句错了 Server.Transfer("Home/Index/" + shengid);
}
else
{
}
return View(); 展开
{
var container = new WeiqiEntities();
if (!String.IsNullOrEmpty(searchString))
{
//var list =container.Sheng.Where(p => p.ShengName == searchString;
var shengid =(from tit in container.Sheng
where tit.ShengName == searchString
select new {tit.ID}).ToList();
//int shengid = int.Parse(list.ToString());
//现在想要根据这个shengid来跳转页面
//跳转语句怎么写
这句错了 Server.Transfer("Home/Index/" + shengid);
}
else
{
}
return View(); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询