您现在的位置是:网站首页> 编程资料编程资料

ASP.NET列出数据库活跃链接的方法_实用技巧_

2023-05-24 186人已围观

简介 ASP.NET列出数据库活跃链接的方法_实用技巧_

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

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

 //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)); }