ASP.NET UserControl not being updated after event?

I think you need to re-bind your grid after your event has fired.

I'm not using a Gridview for reasons that are too lengthy to describe here. – mwright Sep 17 '09 at 21:43 @mwright Re-bind your "custom created and dynamically loaded" controls. – mxmissile Sep 17 '09 at 21:59.

As Locksfree said, a rebind is what you are probably looking for. Postback does not automatically show new data unless you specifically request the new data by calling DataBind() of your asp. Net object.

If you are dynamically creating the table then you will have to rerun the code to rebuild your table again to get the new data. Depending on how it is built you may be able to get away with a partial reload of just the new data.

Check out the following article: highoncoding.com/Articles/374%5FAdding%5....

The button fires an event which triggers an update in the database. This should cause a new set of rows to be shown based on the information entered in the text box. However, the updated information is not being shown unless I force a page refresh.

I suspect this is because of where event handling falls in the asp.net page/control lifecycle. As near as I can tell the values are loaded into the rows before the event is actually triggered, which causes them to get the old values and not the new values that they should have. My question is what is the best way to get around this?

I'm assuming it will be something like checking to see if it's a postback in the page load event and not loading the user control rows but instead causing them to load or to refresh from the event somehow but I'm not sure what that should look like. Edit: I think I need to call the same function that is being called in the Page_Load but I'm not sure how to get to it from the custom control I guess.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions