0
我想在site.master中創建一個變量option_name。從數據庫的輸出數據site.master MVC C#ASP.NET
的Site.Master
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
<% here!!!! %>
<asp:ContentPlaceHolder ID="TitleContent" runat="server" />
</title>
</head>
<body>
</body>
</html>
Configs.cs
[Table(Name = "Site_Config")]
public class Configs
{
[Column(IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]
public int ID_option { get; set; }
[Column]
public string option_name { get; set; }
[Column]
public string option_title { get; set; }
[Column]
public string option_value { get; set; }
}
我寫了一首歌,我想插入變量值的代碼。我知道如何通過「索引」查看,但我希望在所有頁面上顯示值
不是。然後我必須在每個視圖中編寫viewbag ... – Feor 2012-07-06 12:33:21