ASP.NET列出數(shù)據(jù)庫活躍鏈接的方法
本文實例講述了ASP.NET列出數(shù)據(jù)庫活躍鏈接的方法。分享給大家供大家參考。具體分析如下:
這里列出數(shù)據(jù)庫的活躍鏈接。主要使用geeric列表和一個貯存器,創(chuàng)建一個泛型列表的鏈接,如果他們是活躍的,那么他們將顯示在導(dǎo)航了。
//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程序設(shè)計有所幫助。
- 一句話木馬入侵EASYNEWS新聞管理系統(tǒng)
- JSP一句話木馬代碼
- asp.net jscript 一句話木馬
- asp一句話木馬原理分析
- asp,php一句話木馬整理方便查找木馬
- 一句話木馬的原理及利用分析(asp,aspx,php,jsp)
- asp實現(xiàn)讀取數(shù)據(jù)庫輸出json代碼
- 淺談ASP數(shù)據(jù)庫下載漏洞
- MySQL結(jié)合使用數(shù)據(jù)庫分析工具SchemaSpy的方法
- ASP通過ODBC連接SQL Server 2008數(shù)據(jù)庫的方法
- asp.net上傳文件到數(shù)據(jù)庫的解決方案
- ASP語言實現(xiàn)對SQL SERVER數(shù)據(jù)庫的操作
- asp控制xml數(shù)據(jù)庫的經(jīng)典代碼
- ASP網(wǎng)站中數(shù)據(jù)庫被掛木馬的解決方案
相關(guān)文章
阿里云上從ASP.NET線程角度對“黑色30秒”問題的全新分析
在這篇博文中,我們拋開對阿里云的懷疑,完全從ASP.NET的角度進行分析,看能不能找到針對問題現(xiàn)象的更合理的解釋2015-09-09
NetCore實現(xiàn)全局模型綁定異常信息統(tǒng)一處理(場景分析)
本文主要講解NetCore如何使用中間件捕獲模型綁定的異常信息,對NetCore實現(xiàn)全局模型綁定異常信息統(tǒng)一處理場景分析及實現(xiàn)代碼感興趣的朋友一起看看吧2021-12-12
asp.net中Timer無刷新定時器的實現(xiàn)方法
這篇文章主要介紹了asp.net中Timer無刷新定時器的實現(xiàn)方法,是一個非常具有實用價值的技巧,需要用到Ajax技術(shù),需要的朋友可以參考下2014-08-08
asp.net 長文章通過設(shè)定的行數(shù)分頁
長文章通過設(shè)定的行數(shù)來實現(xiàn)分頁的代碼。2009-12-12
動態(tài)加載用戶控件至DataList并為用戶控件賦值實例演示
本文借用使用通用的新聞例子演示動態(tài)加載用戶控件至DataList并為用戶控件賦值,感興趣的朋友可以了解下2013-01-01
在ASP.NET中用MSDNURLRewriting實現(xiàn)Url Rewriting
在ASP.NET中用MSDNURLRewriting實現(xiàn)Url Rewriting...2007-03-03

