Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextBox not updating content

Status
Not open for further replies.

RizMan

Programmer
Jun 13, 2003
20
FR
Ok, here's the situation.
I am quite inexperienced with ASP.NET, so please be patient.
So I have this mainpage, which is basically a simple HTML table which content gets generated based on an XML file.
I have the informations: Author, Comment and Date.
Now I want to allow users to modify their comment. So at the right of every line, there is a link which opens the EDIT webform.
When the webform is opened, I put the informations in the respectiv textboxes i.e. the Comment goes into txtComment.

Now, when I save the new information (done using an XML object which then saves itself to a file), the comment is not changed. When I leave the txtComment.text property empty when openeing the form, the comment is updated fine.

Now after debugging, I noticed that when the txtComment.text property is set to a value in the Page_Load event, changing it's content in the Web Form won't actually change it's "text" property.
Anyone knows what this could possibly be?

I hope I made myself clear
 
An asp.net page will always fire its page_load event on EVERY post back. So if you're assining the value in the Page_Load, unless you wrap that around a

If Not Page.IsPostBack
...
EndIf

the code in the page_load will always fire.

Also, when you said that the Edit webform opens, did you mean in a new window, or in the same browser window? If its in a new window, you have to write extra logic to ensure that the original page is reloaded so the new data is displayed.

hth

D'Arcy
 
I figured it out. Thanks anyway for the reply
 
Riz, can you post what the solution was (always helpful in case others have a similar problem)
:)

D
 
OK, I will post it as soon as I find it next time
 
jfrost:
assuming a new "second" window was opened .... what is the code to re-load the "first" original window which presumably is still visible but with maybe "old" data.
.... (assuming you don't want to open a new window with the latest data)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top