Last post Jul 16, 2008 05:56 PM by ArmanCelestial
Jul 15, 2008 08:17 PM|ArmanCelestial|LINK
I'm a newbie in ASP.Net.
I have a GridView in an Update Panel with a ModalPopup AJAX Control Toolkit. What I'm trying to do is when a user selects a record in the GridView in ModalPopup then click an asp:button, it should closed the ModalPopup and position a FormView outside the
update panel to the record based on the GridView's SelectedValue property. I set the SQLDataSource of the FormView to accept control parameter from the GridView.SelectedValue property. It seems like I have to code to force a postback after closing the ModalPopup
to refresh the FormView to the right record.
I am thinking of coding on okButton_Click Sub below to incorporate forcing postback or re-binding the FormView, whichever works.
. . .
Any help is much appreciated!
Jul 16, 2008 06:47 AM|MelvynHarbour|LINK
You need to look at the way you've set up your UpdatePanel. By default it will be created with ChildrenAsTriggers set to true. This means that all of its child controls will cause an asynchronous postback. By changing it to not automatically do that, you
will be able to define your own triggers, some of which can be asynchronous triggers (AJAX style) and some of which can be synchronous triggers (normal postback).
Jul 16, 2008 01:27 PM|ArmanCelestial|LINK
Thanks for your post!
I think I want to leave ChildrenAsTriggers set to True as that's how I want the GridView to behave in the UpdatePanel. One thing that I'm still figuring is coding behind the OK button in the ModalPopup to grab the GridView.SelectedValue then close the ModalPopup,
and then position the FormView on the main page based on the GridView.SelectedValue. It seems like the FormView is not update because either I need to do a databind() or force a postback in the code. Can you direct me to links on how to do this or if you can
provide sample codes that'll be great!
Jul 16, 2008 05:56 PM|ArmanCelestial|LINK
Anyway, I was able to fix it by simply adding another UpdatePanel and moving the FormView in the UpdatePanel.
Thank you for all the help!