2016-05-10 9 views
1

<asp:Label>をjQueryで表示する方法はありますか?jQueryで表示される<asp:Label>の表示()

私はこのようなラベルがあります:私はこれ持って

<asp:Label runat="server" ID="lblCheckboxesError" Text="test" visible="false"></asp:Label> 

とJSファイル内:

$("[id*=lblCheckboxesError]").show(); 

をしかし、その図示されていません。私はいくつかの解決策を試したが、何も私のために働く。何か案が?感謝:)

答えて

2

使用style="display:none;"代わりに:サーバーで

<asp:Label runat="server" ID="lblCheckboxesError" Text="test" 
    style="display:none;"></asp:Label> 

visible="false"実行(サーバーがブラウザに要素を送信しません)

style="display:none;"はjQueryのshow()作品ので、ブラウザ内の要素を隠します。

0
Make sure the id is generated with same as given "lblCheckboxesError" in the html and style is set as "display:none" as show/hide acts on display property of style attribute. Then you could access the control as: 

$('#lblCheckboxesError').show(); 

テンプレート:$( '#のID')ショー()

関連する問題