我有一个标签登录页面,我想在每个标签上承载单个窗体,但是从它们后面的代码位于单个页面上。jquery设置dotnet窗体visible = true和false
这意味着有两种形式。
例如:
<nav id="secondary">
<ul>
<li id="current"><a href="#login">Login</a></li>
<li><a href="#forgot">Forgot Password</a></li>
</ul>
</nav>
<div id="login" class="tab">
<br /><br />
<form runat="server" visible="true" class="frmControl">
</form>
</div>
<div id="forgot" class="tab">
<br /><br />
<form runat="server" visible="false" class="frmControl"></form>
</div>
,然后我有以下的jquery到登录DIV之间切换,忘了DIV
$(".tab").hide();
if ($("nav#secondary ul li.current").length < 1) {
$("nav#secondary ul li:first-child").addClass("current");
}
var link = $("nav#secondary ul li.current a").attr("href");
$(link).show();
$("nav#secondary ul li a").click(function() {
if (!$(this).hasClass("current")) {
$("nav#secondary ul li").removeClass("current");
$(this).parent().addClass("current");
$(".tab").hide();
$(".frmControl").attr("Visible", "false");
var link = $(this).attr("href");
$(this).attr("Visible", "true");
$(link).show();
initBackground();
}
return false;
});
它不能正常工作,因为它是唯一设置”。 frmControl'class to visible = false。但是当我重新激活选项卡时,它不会再为活动选项卡表单设置为true,并将非活动选项卡表单设置为false。
对不起,如果我没有正确解释。
-RD
你不能有一个以上的形式是'runat =“server”'并且表单没有客户端'Visible'属性,至少有一个对你有好处。你需要使用'hide/show'。 – tvanfosson