Page_Load not firing 2nd time round?

Discussion in 'ASP .Net' started by Craig Miles, Jun 25, 2004.

  1. Craig Miles

    Craig Miles Guest

    Hi,

    I have Form1.aspx. Form1 uses client side javascript to launch Form2.aspx
    when a button is clicked:
    window.showModalDialog("Form2.aspx?xxxxx=xxxx") etc.

    The first time the Form1 button is clicked the Form2 Page_Load (server side)
    is fired.
    I close Form2 returning to Form1. Click the button again. This time when
    Form2 loads
    there is no Page_Load() event.

    Why doesn't it fire?

    Thanks,
    Craig Miles.
     
    Craig Miles, Jun 25, 2004
    #1
    1. Advertisements

  2. Craig Miles

    Craig Miles Guest

    Found the answer. Had to add the following code in Form2's Page_Load to stop
    it caching:
    Response.Expires = 0
    Response.Cache.SetNoStore()
    Response.AppendHeader("Pragma", "no-cache")

    Regards,
    Craig Miles.
     
    Craig Miles, Jun 25, 2004
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.