Asp.net菜单控件
时间:2010-11-18 来源:AngelLee2009
现在在.NET开发项目时,想采用类似的方法。
Menu.ascx<style type="text/css">
.b{font-weight:bold;}
</style>
<ul>
<li<%=ht["Index"]%>>首页</li>
<li<%=ht["News"]%>>公司新闻</li>
<li<%=ht["AboutUs"]%>>关于我们</li>
</ul>
{
protected Hashtable ht = new Hashtable();
public string strStyle = null ;
protected void Page_Load(object sender,EventArgs e)
{
ht[strStyle] = " class=\"b\"";
}
}
Index.aspx<%@ Register Src="~/Controls/Menu.asx" TagPrefix="Lee" TagName="Menu" %>
<Lee:Menu ID="Menu" runat="server" strStyle="Index"/>
相关阅读 更多 +
排行榜 更多 +