1. 动态获取地址栏的参数,在母版页 F7下设置:
admin.Master.cs
public partial class admin: System.Web.UI.MasterPage { public int menuId=0; protected void Page_Load(object sender, EventArgs e) { string url = Request.RawUrl.ToLower().Trim(); if (url.Contains("feedback.aspx")) menuId= 1; else{ menuId = 0; } } }
admin.Master
<div class="login_menu"> <a href="NewList.aspx" <%=menuId==0?"class=‘cur‘":"" %>>内容管理</a><a href="Feedback.aspx" <%=menuId==1?"class=‘cur‘":"" %>>投诉与反馈</a> </div>