Popup and .Net (Update)
Regarding my post on my issue with client side scripting and .Net, Jesse help me a lot on the subject. I still have to test his answer but this is what he suggest:
a better handler in the popup would look like this:
void MySubmitButton_Click(object sender, EventArgs e)
{
// Do Some Processing
Page.RegisterStartupScript("__close", String.Format("<script>window.opener.{0}({1},{2}); window.close();</script>", Request["Handler"], Request["ControlID"], someValue));
}
So, what happens is a user clicks a button in your popup (for example, a "Save" button). You do some processing on the data, like saving it to a database. After you have done this, you send a javascript to the browser that fires calls a function on the parent window, and then closes the popup. The function on the parent window is responsible for making sure that the page refreshes. There are a million ways to do this. You could just use DOM with DHTML to update the page automatically, without a refresh. Or, you could use the __doPostBack function to initiate a postback event. Or, you could do something like "window.location = window.location". To simulate a page refresh. Personally, I like using DHTML to dynamically update the page best, but some times that is not an option and firing a custom __doPostBack event is best for those cases.
The only comment I would like to add is that I don't have any button in the popup window. I have no idea if and when the user will close the window, so I will probably include the code on a on load event (Javascript).
I will try this code and let you know if it's working. I'm sure it is, coming from Jesse, it surely is ;-)
Any comments?