help.net

<font size="2"><br />Musing on .Net</font>

  • 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?

  • IE


    Just my two cents on the frenzy blogs I read about Internet Explorer and his future.
    I read that people start to think about using other browsers.

    I think some people have a short memory.
    Do you remember all the hard time to have a simple web page working for a lot of users just two years ago ?

    The time where you have to deal with different browsers, Javascript or some obscure bugs in Netscape or IE 4.

    I am personally happy with IE 6. It can be improve, but it does exactly what they say on the tin and it seem to be use by the whole Internet community.

    I am not ready to come back again to the time where you have to test every single HTML code to be compliant with Netscape 3 or IE3.
    I like having .Net doing the browser test for me, and maybe it's not perfect, but it works even on a Macintosh !

    And for those who talk about Mozilla, how many versions should be there before having no more crash on my PC?

  • CMS


    If you are interested you can read the comments I received on my post about CMS, static or dynamic.

    The debate now seem to go on the caching options.
    I just commented about the difficulty to cache partially some elements of a page.

    Maybe I am wrong so feel free to comment.

  • Code Recovery


    Commenting my post about my unfortunate crash, Drew write:

    I feel your pain. My HD crashed two weeks ago, on my first day in a two week trip to Japan. Ouch! My most recent backup was spotty. I have some demos and other projects that are not "production," nonetheless I put some significant hours into just before I left. Gone. Stupid me.

    I didn't obsfucate any of the assemblies, so I'm going to try some decompilers. The word is they can produce some pretty clean code from .NET assemblies.

    Does somebody know more about these tools. Am I able to retrieve something useful from the assembly ?