473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.getElementById('cell1').style.display = '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.RegisterClientScriptBlock()
Is there a step that I am missing?
Oct 5 '07 #1
1 1218
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.getElementById('cell1').style.display = '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.RegisterClientScriptBlock()
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.
Oct 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Scott Baxter | last post by:
Hello, I got the following scripts to upload files to my directories I call insert.htm Browse for a file, then click 'submit' It works for small files, and for a small .mdb (access file)
2
by: . . | last post by:
Hi I need some help with java script . I have a ASPX page that is pulling a user message heading from the table on the page . The user message header has message body which suppose to dispay...
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
0
by: anonymous | last post by:
Thanks Michelle, How could I achieve the second one.I do not like Flashing windows in response to selection of an item. I agree the data transfer is very little but the same data transferred for...
4
by: TJS | last post by:
how do I get "onSubmit" to work in .net ? <Form id="Form1" name="Form1" method="post" onSubmit="return validateStandard(this, 'error');" runat="server">
2
by: Luis Ferrao | last post by:
Hi, I have some code that looks like this: -- CODE ---------------------------- Public Class NodeEditor Inherits System.Web.UI.Page Protected WithEvents ChildList As...
4
by: fxs | last post by:
Hello, I've got the following elements on my page: A Body tag that looks like this: <body onload="setTabs()"> A Javascript script in the <head> that has: var foo; function setTabs() {...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
3
by: John Kotuby | last post by:
Hi all, I am converting an ASPX 3.5 page in VB and VS 2008 from the standard postback to callbacks using an UpdatePanel. I had originally been adding an onload attribute to the Body tag in the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.