Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Problem with Post Back and User Control

Reply
Thread Tools

Problem with Post Back and User Control

 
 
James Todman
Guest
Posts: n/a
 
      10-12-2004
I have a user control that contains a data grid type control (it's part of a
3rd party DAL), a text box and a button. When the button is clicked it takes
the text and stores it in the database. I then want the data grid to re-bind
to the datasource, refresh itself, so that when the page is then rendered
afterwards, the data is shown.

I've added an OnClick event handler for the button that adds the data to the
database, it then resets the grid, rebinds and refreshes. However, this for
some reason doesn't actually show the updated data until I re-navigate to
the page.

If I change the code so that the update is done during the user control's
OnLoad event and check the IsPostback property and handle the update inside
there it works. However, I only want to store the data if they click on the
button inside the user control. There are other controls that can cause a
postback, and I don't want the data to be stored when another button is
clicked.

My question is, is this the intended behaviour? It seems that rendering is
performed before the event is handled. Should the control be doing something
else to ensure that the grid is refreshed by the time the page comes to
render?

Cheers,
James


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
User Control and Post Back =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?= ASP .Net 3 07-02-2006 12:00 AM
Dropdownlist post back problem in user control jonathanyan@gmail.com ASP .Net 0 07-07-2005 09:25 PM
user control dissapears from panel on post back =?Utf-8?B?VHJveQ==?= ASP .Net 1 01-23-2004 08:05 PM
Button Controls in user control does not post back. sk2000 ASP .Net 2 11-12-2003 07:26 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57