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. passing control inside detaliview or gridview to javascript

passing control inside detaliview or gridview to javascript

Scheduled Pinned Locked Moved ASP.NET
javajavascripttoolshelpquestion
2 Posts 2 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.
  • J Offline
    J Offline
    justintimberlake
    wrote on last edited by
    #1

    I have a asp:calendar with id Calendarstartdate inside detailview which I want to show and hide base on a button just next to it. But when I access calendar1 in javascript var CalRef = document.getElementById('<%=Calendarstartdate.ClientID%>'); I get compile error The name 'Calendarstartdate' does not exist in the current context how do I overcome this and get correct id of calendar

    //java script function HideshowCalendar() { var CalRef = document.getElementById('<%=Calendarstartdate.ClientID%>'); }

    T 1 Reply Last reply
    0
    • J justintimberlake

      I have a asp:calendar with id Calendarstartdate inside detailview which I want to show and hide base on a button just next to it. But when I access calendar1 in javascript var CalRef = document.getElementById('<%=Calendarstartdate.ClientID%>'); I get compile error The name 'Calendarstartdate' does not exist in the current context how do I overcome this and get correct id of calendar

      //java script function HideshowCalendar() { var CalRef = document.getElementById('<%=Calendarstartdate.ClientID%>'); }

      T Offline
      T Offline
      TheWirelessGuy
      wrote on last edited by
      #2

      To figure out what's going on, open your page in the browser, then select "view source" (from the brower menu). Look at the html code and your javascript function. Is there a DOM element with the ID your javascript is attempting to hide/show? This should give you an indication of where the problem is.

      Steve

      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