Posted in Javascript onMarch 03, 2013
思路:母版??藏控件 ?哪谌蓓?接收值 JS根??邮艿闹悼刂撇?雾?的???
母版?:
?藏控件:
<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>
内容??母版??藏空??值:
//?置母版?Lable的值,以控制菜?雾?CSS
Label X = (Label)this.Master.FindControl("Lbl_X"); X.Text = "A"; Label Xn = (Label)this.Master.FindControl("Lbl_Xn"); Xn.Text = "A1";
js 控制下拉菜单刷新的方法
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@