在帖子后面保持隐藏和显示 [英] Maintain hide and show between post back

查看:68
本文介绍了在帖子后面保持隐藏和显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我点击checkbox.its显示并使用jquery隐藏面板。

但是按下按钮后面板的状态在asp.net中丢失,无论状态如何。有人知道如何解决这个问题



我尝试过:



I am clicking on checkbox.its showing and hiding the panel using jquery.
but after button click the state of panel is lost in asp.net whatever its state is.have anybody idea how to resolve this issue

What I have tried:

$(document).ready(function () {
           $("#<%=CheckBox1.ClientID %>").click(function () {
               if ($("#<%=CheckBox1.ClientID %>").is(":checked")) {
                   $("#<%=Panel1.ClientID %>").show();
                   }
               if (!$("#<%=CheckBox1.ClientID %>").is(":checked")) {
                   $("#<%=Panel1.ClientID %>").hide();
                                  }
           });

           $("#<%=Panel1.ClientID %>").hide();
       });

推荐答案

document )。ready ( function (){
(document).ready(function () {


#<%= CheckBox1.ClientID%>)。click( function (){
if
("#<%=CheckBox1.ClientID %>").click(function () { if (


#<%= CheckBox1.ClientID%>)。is( :checked)){
("#<%=CheckBox1.ClientID %>").is(":checked")) {


这篇关于在帖子后面保持隐藏和显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆