Problem looping through Controls

Results 1 to 2 of 2

Thread: Problem looping through Controls

  1. #1
    Join Date
    Dec 1969

    Default Problem looping through Controls

    I create a bunch of HTMLInputHidden controls and add them to a PlaceHolder programmatically. In a button event, I use FindControl to locate the PlaceHolder then loop through the PlaceHolders controls to get to the HTMLInoutHiddens.<BR><BR>Problem is that during the button event, after I FindControl on the PlaceHolder the control count is 0. I truned tracing on and I can see my HTMLInputHidden controls in the controls heirarchy.<BR><BR>I have attempted to add the HTMLInputHidden to the Page itself, then looping through the Page/Form controls ... but still no HTMLInputHidden controls can be found in the controls heirarchy. I have attempted this with textboxes in place of the HTMLInputHidden but have met with the same results.<BR><BR>I thought this was going to be easy ...

  2. #2
    Join Date
    Dec 1969

    Default RE: Problem looping through Controls

    Can you reference the hdn controls by name? Maybe just a request.form("hdnNNN") if the controls are named numericly. Or a frmName.findcontrols("phName").findcontrols("hdnNa me").value ? If they are hidden controls why do you need a placeholder in the first place? You should be able to just add them anywhere on the form.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts