Clientside Script not finding elements only on first load. (Asp.net)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • javalsu
    New Member
    • Oct 2007
    • 3

    #1

    Clientside Script not finding elements only on first load. (Asp.net)

    I have an Asp.net page. It's basically a Calendar.
    The calendar frame is created with the <table> tag in the codebehind.
    some of the cells are named ie. <td name="cell1" id="cell1>
    during each postback, the program figures out which cells are to be displayed. By editing the display parameter.

    document.getEle mentById('cell1 ').style.displa y = 'None';

    Everything. Works fine on the postbacks, but not on the first load.

    Infact, if I try to read any element using getElementById on the first load, I get nothing.

    This page is Ajax enabled so for the client side registration I am using

    ScriptManager.R egisterClientSc riptBlock()
    Is there a step that I am missing?
  • Yardgnome
    New Member
    • Oct 2007
    • 6

    #2
    Originally posted by javalsu
    I have an Asp.net page. It's basically a Calendar.
    The calendar frame is created with the <table> tag in the codebehind.
    some of the cells are named ie. <td name="cell1" id="cell1>
    during each postback, the program figures out which cells are to be displayed. By editing the display parameter.

    document.getEle mentById('cell1 ').style.displa y = 'None';

    Everything. Works fine on the postbacks, but not on the first load.

    Infact, if I try to read any element using getElementById on the first load, I get nothing.

    This page is Ajax enabled so for the client side registration I am using

    ScriptManager.R egisterClientSc riptBlock()
    Is there a step that I am missing?
    Your script is probably being run before the page had loaded your calendar.
    You could put your script at the very end of your page so that your calendar
    will have been loaded by the time the script is executed.

    Comment

    Working...