主頁 > 知識庫 > ASP.NET列出數(shù)據(jù)庫活躍鏈接的方法

ASP.NET列出數(shù)據(jù)庫活躍鏈接的方法

熱門標簽:阿里云 百度競價排名 科大訊飛語音識別系統(tǒng) 硅谷的囚徒呼叫中心 地方門戶網(wǎng)站 服務器配置 集中運營管理辦法 網(wǎng)站排名優(yōu)化

本文實例講述了ASP.NET列出數(shù)據(jù)庫活躍鏈接的方法。分享給大家供大家參考。具體分析如下:

這里列出數(shù)據(jù)庫的活躍鏈接。主要使用geeric列表和一個貯存器,創(chuàng)建一個泛型列表的鏈接,如果他們是活躍的,那么他們將顯示在導航了。

//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 (ListService>)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ù)庫被掛木馬的解決方案

標簽:梧州 甘孜 烏蘭察布 西雙版納 威海 隨州 廣西 開封

巨人網(wǎng)絡(luò)通訊聲明:本文標題《ASP.NET列出數(shù)據(jù)庫活躍鏈接的方法》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266