JQuery的.Show()不能与服务器控件工作? [英] JQuery .Show() doesn't work with server control?

查看:141
本文介绍了JQuery的.Show()不能与服务器控件工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个HTML TR,我让他们 =服务器&安培; 可见=假和我有一个名为DropDownList的 citiesDropDownList

I have 2 html TR that i make them runat="server" & visible="false" and I have a dropdownlist called citiesDropDownList

$(document).ready(function() {
$('#<%=citiesDropDownList.ClientID %>').change(function() { ValidateCity(); });
});

和这个DropDownList的我检查的变化,如果它的文本等于字符串我显示2 TR如下

and on change of this dropdownlist i check if the its text equal to a string i show the 2 tr as below

function ValidateCity() {
        if ($('#<%= citiesDropDownList.ClientID %> :selected').text() == identity_CityOther)   {
            $('#<%= otherCityTR.ClientID %>').show();
            $('#<%= areasTR.ClientID %>').show();
        }
        var city = $('#<%= citiesDropDownList.ClientID %>').val();
        return IsValid((city.length != 0), '#<%= cityDiv.ClientID %>', identity_CityRequired);
    }

.show()是不是在所有的工作,我不的原因..可以在任何导致我得到这个问题?

.show() isn't work at all and i don't the reason .. can any lead me to get the problem ?

FYI:我试过 $('#&LT;%= otherCityTR.ClientID%GT;')节目(慢); $('#&LT;%= otherCityTR.ClientID%GT;')的CSS('知名度','看得见'); ,但它不也行...

FYI : I tried $('#<%= otherCityTR.ClientID %>').show('slow'); and also $('#<%= otherCityTR.ClientID %>').css('visibility', 'visible'); but it doesn't work also ...

推荐答案

可见=假意味着它甚至不会渲染到页面,让你选择目前还没有找到任何元素。

visible="false" means it doesn't even get rendered into the page, so your selectors aren't finding any elements.

而不是可见=假使用风格=显示:无;来隐藏元素,但仍然使它们在页面中。

Instead of visible="false" use style="display: none;" to hide the elements, yet still render them in the page.

这篇关于JQuery的.Show()不能与服务器控件工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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