当前在线人工客服
天达云-技术
QQ:1324027256
天达云-技术
QQ:1902643386
天达云-售前
QQ:1650874901
天达云-售前
QQ:2207995833
天达云-合作
QQ:1984186903
天达云微信小程序
400-837-6568

ASP.NET中怎么列出数据库活跃链接
更新:HHH   时间:2023-1-7


本篇文章为大家展示了ASP.NET中怎么列出数据库活跃链接,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。

具体分析如下:

//First in C# where you create the controller action method 
//to create the method that will populate all content details
//add the following code
public ActionResult Details(int id)
{
 var repositoryList = _repository.List();
 ViewData["List"] = repositoryList;
 return View(_repository.Get(id));
}
<!--now is ASP.net add the following in your navigation panel->
<ul>
  <% foreach (var item in (List<Service>)ViewData["List"])
  {%>
   <% if ((item.isActive) || (item.id != 0)) 
    { %><li><%=Html.ActionLink(item.Title, "Details", new { id = item.id })%></li><%} %>
  <%} %>
</ul>

上述内容就是ASP.NET中怎么列出数据库活跃链接,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注天达云行业资讯频道。

返回开发技术教程...