P
Paul
Hi, my problem is that I can't get getElementById to find the ID of any
controls on my page. To whit:
The following code-behind returns the error, "lblErrorText is
undefined.":
Response.Write("<script language=javascript>var errorText =
document.GetElementById(lblErrorText).innerHTML; alert('SQL error: ' +
errorText)</script>")
With 'lblErrorText' I get: "Object doesn't support this property or
method."
With "lblErrorText" I get: "Comma, ), or valid expression continuation
expected." from the compiler.
Does this have something to do with the object not existing during a
postback? I've tried the line in Page_Load() and in lblErrorText_Load()
to no avail. What am I missing?
Thanks - Paul
controls on my page. To whit:
The following code-behind returns the error, "lblErrorText is
undefined.":
Response.Write("<script language=javascript>var errorText =
document.GetElementById(lblErrorText).innerHTML; alert('SQL error: ' +
errorText)</script>")
With 'lblErrorText' I get: "Object doesn't support this property or
method."
With "lblErrorText" I get: "Comma, ), or valid expression continuation
expected." from the compiler.
Does this have something to do with the object not existing during a
postback? I've tried the line in Page_Load() and in lblErrorText_Load()
to no avail. What am I missing?
Thanks - Paul