I
ipramod
Hi All,
I have below label which is invisible when the page loads.
<asp:Label ID="lblTest" runat="server" Visible="false" Text="Test"></
asp:Label>
Now if I want to make this label visible on the web page, I used
below
javascript:
document.getElementById("<%= lblTest.ClientID %>").style.display =
"block";
But when the Javascript code is executed, I get below exception:
"Object required"
As per my observation, if the control is not loaded at the first time
then it will not have the client id and it will throw an exception.
Same is the case with DIV. I have 2 DIV's which are invisible on the
page load and in special cases I want to make one DIV visible and
make
other invisible then I get the above exception.
So, is there any way to make the controls visible/invisible
regardless
of their initial stage?
Please let me know ASAP.
Thanks in advance,
PI
I have below label which is invisible when the page loads.
<asp:Label ID="lblTest" runat="server" Visible="false" Text="Test"></
asp:Label>
Now if I want to make this label visible on the web page, I used
below
javascript:
document.getElementById("<%= lblTest.ClientID %>").style.display =
"block";
But when the Javascript code is executed, I get below exception:
"Object required"
As per my observation, if the control is not loaded at the first time
then it will not have the client id and it will throw an exception.
Same is the case with DIV. I have 2 DIV's which are invisible on the
page load and in special cases I want to make one DIV visible and
make
other invisible then I get the above exception.
So, is there any way to make the controls visible/invisible
regardless
of their initial stage?
Please let me know ASAP.
Thanks in advance,
PI