Accessing values of child controls after postback

M

Martin Pichler

Hi!

I have a placeholder to which i add a Table with 2 columns. In one of the
columns are textboxes with an unique ID (box1, box2, .... boxN). the user is
supposed to enter values into these textboxes and then klick submit (button
is static). on the click event i want ro read out the values of the boxes
and save them into a database.
here comes the Problem:
with Findcontrols("Box1") i am unable to find my dear textboxes!
plDetails.controls.count gives always zero (it should be one since the is a
Table)!

obviously they all vanish... or something alike.

i dont care if the values get saved in the viewstate, i just want to read
them out and save em!

Any ideas?

any help appreciated!

Thanx martin
 
T

Teemu Keiski

If you create controls dynamically, you need to that on every request
despite is it postback or not. That means adding Table etc to Placeholder on
every request and in same order. That way you could access values after
postback.

--
Teemu Keiski
MCP,Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 
E

elkay

Can you post a snippet of your code...
I am having a similar problem. I have posted my problem in
microsoft.public.dotnet.framework.aspnet.webcontrols
"Passing controls......in placelholder......."
Would appreciate any help in this regard.
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top