手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >ASP.NET列出数据库活跃链接的方法
ASP.NET列出数据库活跃链接的方法
摘要:本文实例讲述了列出数据库活跃链接的方法。分享给大家供大家参考。具体分析如下:这里列出数据库的活跃链接。主要使用geeric列表和一个贮存器,...

本文实例讲述了列出数据库活跃链接的方法。分享给大家供大家参考。具体分析如下:

这里列出数据库的活跃链接。主要使用geeric列表和一个贮存器,创建一个泛型列表的链接,如果他们是活跃的,那么他们将显示在导航了。

? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 //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 add the following in your navigation panel- % foreach (var item in (ListService)ViewData[List]) {% % if ((item.isActive) || (item.id != 0)) { %li%=Html.ActionLink(item.Title, Details, new { id = item.id })%/li%} %

希望本文所述对大家的程序设计有所帮助。

【ASP.NET列出数据库活跃链接的方法】相关文章:

ASP.NET 运行.bat文件的实现方法

ASP.NET防止页面刷新的两种解决方法

asp.net中导出excel数据的方法汇总

在ASP.NET中调用存储过程方法新解

ASP.NET输出PNG图片时出现GDI+一般性错误的解决方法

ASP.NET创建动态缩略图的方法

asp.net刷新本页面的六种方法

ASP.NET中为GridView添加删除提示框的方法

ASP.NET弹出消息框、确认框的代码收集

ASP.NET清空SQL日志的具体方法

精品推荐
分类导航