force controls to run first?

Results 1 to 2 of 2

Thread: force controls to run first?

  1. #1
    Join Date
    Dec 1969

    Default force controls to run first?

    I've got a page with a number of dynamically placed controls on the page. Each control has an address in it with a link button. When you click the link button, it's supposed to delete the address which it's doing. The problem is that since it's a control on the page, it's delete procedure is executing after the page load of the containing page. Since this happens, the main page loads the address controls and then fires the delete method. The result is that even though it deletes the address, the parent page is done loading, so it still has the address control on the page and to the user, it appears that the address was not deleted. The only way I can think to handle this is to put a response.redirect in the delete method of the control so that it just hits the page again to refresh it. But, I'd rather not do that because that's an additional database hit. So, what I was wondering is is there a way to call my delete method in the control before the parent page finishes with it's page_load method? Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: force controls to run first?

    Not to my knowledge. Check for postback before loading control. Either that, or turn the visible property of the control off in the delete method, so even though you're loading it, it won't show. Probably better off checking for postback though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts