Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I have a problem on a webform on which I have several textbox fields and a submit server control button. When I display the first time my webform, it reads a database and displays values in the textbox fields. Then the user will have to change the values and click on the submit form and when I do that, the values in the textbox fields have not changed, it saves the values displayed on the first display... :(

 

Does anyone have an idea.

 

NB : I tried with a new webform with only 2 textbox fields and it works, so, it is not a web.config parameter or something like that...I checked the Viewstate enable/disable values and there's nothing special (I kept the default values : enabled). I checked also that the submit button Causes validation (property "CausesValidation" =true).

Scalf.

Do not want others to know what you have done? Better not have done it anyways.

Posted
Lets see some code.

 

OK, it has been solved, I forgot adding "If Not Page.IsPostback" at the beginning of my code :o which made the textbox fields always be reinitialized by the values of database instead of keeping the changed values.

 

Many Thanks to you.

Scalf.

Do not want others to know what you have done? Better not have done it anyways.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...