<asp:Label ID="Lbl_X" runat="server" Text="text" style="display:none"></asp:Label>
<asp:Label ID="Lbl_Xn" runat="server" Text="text" style="display:none"></asp:Label>
JS:
<%-- 设置选中--%>
<script type="text/
javascript">
var X = document.getElementById('<%=this.Lbl_X.ClientID %>').innerText;
var Xn = document.getElementById('<%=this.Lbl_Xn.ClientID %>').innerText;
var div = document.getElementById(X);
if (div != null) {
div.setAttribute("class", 'nav-top-item current');
}
var div2 = document.getElementById(Xn);
if (div != null) {
div2.setAttribute("class", 'current');
}
</script>