Controle ViewState

P

papis

Hie,

I have a big problme I generate a table in wich I put some sever
controls like (dropdownlist...) and whenever I click in subimit button even
if there is no code in the button the page is republished and all the
controls are reset and i cant get the value entered by the user. Would
you mind help me please.
Thank you


___
Newsgroups brought to you courtesy of www.dotnetjohn.com
 
Q

Quickstone

Where are you generating your controls (in Page_Load)? And
are you generating them in the "If Not IsPostback"
statement?
Also are you initializing the values of your controls
anywhere? For instance if you have a textbox called
txtUserName, when you add it to your control do you also
say txtUserName.Text = "". Because you should only
initialize the values of the controls in the "If Not
IsPostback" statement, but you should always add your
controls on each page load (not in the "If Not IsPostback"
statement).
 
A

Alioune Seck

Hie,
Thanks a lot for replying.
I don't generate the table and it's related server control in the load
page. Because I want the user gives the number of row he wants. that's
why I only load a label and a textbox in the load_page and then if he
enter a number I use it to generate the rows and the controls. First I
tryed to use the the function TextBoxTextChanged() with handler to
automaticaly generate them but it didn't work that why now I use I
button in and i put the code into it but it didnt work also. Note that I
dont initialize any controls.
thank you
 

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,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top