Dynamic Controls and MasterPage Problem

D

dawg1998

I have a page that creates dynamic textboxes based on the number of
fields a user chooses to fill out. Basically, I am able to create the
controls via this method (with other details):

Dim txtbxTextBox as New Textbox()
Form.Controls.Add(txtbxTextBox1)

Then, when the page is submitted (via Postback) I grab the value in the
textbox like so:

Dim strString As String
strString = Request.Form("txtbxTextBox")

This process worked great when the page was standalone. However, when I
move to a Content/MasterPage setup, the MasterPage "form" seems to be
interfering with the ability of my code to retrieve the value in the
dynamic control.

Are there any ideas on why this is happening or how to work-around the
problem? Should I be doing the request at a different level since the
Form resides in the MasterPage now?

I already tried re-creating the textboxes on Page_Load and Page_Init to
no avail. The values just come back as 0 every time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top