Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. custom control visibility

custom control visibility

Scheduled Pinned Locked Moved ASP.NET
javascripthtmldesignsysadminhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kjosh
    wrote on last edited by
    #1
    1. 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
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups