custom control visibility
ASP.NET
1
Posts
1
Posters
0
Views
1
Watching
-
- I have one custom control Datepicker. In my aspx page I am using that custom control liek the below: <asp:RadioButtonList ID="rbl" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1" onclick="ChangeA(this)">a</asp:ListItem> <asp:ListItem Value="2" onclick="ChangeB(this)">b</asp:ListItem> </asp:RadioButtonList> <vv:DatePicker ID="Dp1" Text="StartDate" .../> <vv:DatePicker ID="Dp2" Text="EndDate"> When the option"a" is selected I have to show the dp1, dp2. When "b" is selected, hide the Dp1, Dp2. So I have the Javascript like the below: function ChangeA(theradio) { document.getElementById('<%=Dp1.ClientID%>').style.visibility = 'visible'; document.getElementById('<%=Dp2.ClientID%>').style.visibility = 'visible'; } function ChangeB(theradio) { document.getElementById('<%=Dp1.ClientID%>').style.visibility = 'hidden'; document.getElementById('<%=Dp2.ClientID%>').style.visibility = 'hidden'; } I am getting the error "Object required" . for the Dp1, Dp2. If I put the Text boxes insted of Dp1, Dp2 the Javascript code is working fine. How to set visibility for custom control. 2) I have Textbox for which visibility is set to False by design. How to set visibility True using Javascript. My page is having the Master page not HTML body. For this also I am getting Object required error. Thanks in advance