Help with dynamic form elements on ASP:Panel

Results 1 to 2 of 2

Thread: Help with dynamic form elements on ASP:Panel

  1. #1
    Join Date
    Dec 1969

    Default Help with dynamic form elements on ASP:Panel

    I&#039;ve done reg asp fer a bit and kinda new to C# but gettin the hang of it pretty quick. I&#039;ve run into a problem though. <BR><BR>All I really need to know is how to read values from form elements on a panel that are dynamically created...<BR><BR>I have a panel and am creating dynamic form elements in that panel based off of a drop down choice. So for example, you choose drop down option #1 i have a text box in that panel, if you do option #2 in the drop down i have a checkbox in that panel.<BR><BR>.aspx<BR>Panel is created like this:<BR>&#060;asp:Panel id="pnlQuestionCreation" runat="server" /&#062;<BR><BR>.cs<BR>I am adding elements in the backend no problem:<BR>TextBox elParameter01 = new TextBox<BR>elParameter01.ID = "parameter01";<BR><BR>The problem I&#039;m having is reading that variable on the postback, I can&#039;t for the life of me get the Text value from the form element parameter01.<BR><BR>I&#039;ve been doing something like this...<BR>pnlQuestionCreation.FindControl("parame ter02").Text;<BR><BR>but that fails, I can&#039;t seem to get the Text option no matter what I try...<BR><BR>any info would greatyly be appreciated, thanks so much.

  2. #2
    Join Date
    Dec 1969

    Default RE: Help with dynamic form elements on ASP:Panel

    I&#039;m using Request.Form.Get(control_name) to get the control&#039;s value. TEXT will never be an option with FindControl. Hope this helps.

Posting Permissions

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