Last post Mar 31, 2008 08:42 AM by NC01
Mar 27, 2008 04:39 PM|gbrot|LINK
just fine on the page in normal view. Are the dynamic controls in some other hidden page or encrypted somewhere?
Here's a snippet of what I'm doing:
TextBox txtDim = new TextBox();
txtDim.ID = "txtDim" + i.ToString();
txtDim.Attributes.Add("onBlur", "DecimalToFeet('" + txtDim.ID + "');");
var InputControl = document.getElementById(InputBoxID);
psDim = InputControl.value;
..bla bla bla...
InputControl.value = psDim;
Mar 27, 2008 05:53 PM|whatispunk|LINK
There are a couple subtle mistakes in your code.
Second: You must add txtDim to the pnlDims.Controls collection in order for this ClientID to be created.
1 TextBox txtDim = new TextBox();
2 txtDim.ID = "txtDim" + i.ToString();
"DecimalToFeet('" + txtDim.ClientID +
Mar 28, 2008 10:48 AM|gbrot|LINK
Thanks for the response,
I can see that I did have some bugs in that code. I tried the changes you mentioned but I'm still having the same issue. It just seems that I'm missing something when it comes to accessing dynamic controls. The fact that I can't see the dynamic controls
Mar 28, 2008 12:42 PM|whatispunk|LINK
If you use IEs View Source you won't see them, but if you use something FireFox's FireBug, or IEs IE Developer Toolbar, you will see the dynamic changes in real time.
Mar 28, 2008 12:44 PM|whatispunk|LINK
Try using UniqueID instead of ClientID
Mar 28, 2008 01:50 PM|gbrot|LINK
Using UniqueID fixed it! Thanks, I would have never figured that out.
Mar 28, 2008 02:03 PM|NC01|LINK
Change to this:
// var InputControl = document.getElementById(InputBoxID);
// Rest of your code...
Mar 28, 2008 02:26 PM|gbrot|LINK
Mar 31, 2008 08:42 AM|NC01|LINK