3

I've been thrown into an ASP.NET project and I've got a page which contains a control that is fetched via AJAX.

The Page_Load function of the control does a little bit of logic necessary to get the correct values from the Query string.

The problem is that the Page_Load function isn't called in IE.

If I put a breakpoint in, I can load the page in FF and watch it stop, but in IE: no deal.

I'm pretty (read: COMPLETELY) new to ASP.NET, but I'm a pretty experienced PHP developer. So I'm thinking it's probably some funk with the way that IE does the AJAX callback to get the control.

Has anyone got any ideas?

Cheers

tobyc
  • 2,237
  • 2
  • 20
  • 26

6 Answers6

5

It seems like it was a caching issue, solved by doing something like this:

protected override void OnLoad(EventArgs e)
{
    Response.Cache.SetNoStore();
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.Cache.SetExpires(DateTime.Now);
    Response.Cache.SetLastModified(DateTime.Now);
    Response.Cache.SetAllowResponseInBrowserHistory(false);
    base.OnLoad(e);
}
tobyc
  • 2,237
  • 2
  • 20
  • 26
1

Maybe try debugging the javascript to see if it ever trys to get the control in IE? If you can. Better yet, watch in Fiddler. http://www.Fiddler2.com

John Hoven
  • 4,085
  • 2
  • 28
  • 32
1

If it's the caching, you should turn it off by using the OutputCache directive:

<%@ OutputCache Duration="0" VaryByParam="None" %>
Iain Holder
  • 14,172
  • 10
  • 66
  • 86
0

i'd try to use the IE Developer Toolbar to help debug the IE problem but I think you are on the right track.

You can also enable script debugging in the Advanced Options of IE and debug the script.

Jeff Martin
  • 10,812
  • 7
  • 48
  • 74
0

What is inside the Page_Load? Either EventWireup is set to false on the ASPX page, or it's something in the code.

BBetances
  • 925
  • 1
  • 14
  • 23
  • 1
    Hrm, EventWireup isn't specified, which from what I've read means it defaults to true. Is there anything prior to Page_Load that would invalidate it (for IE only)? The fact that it's IE only leads me to believe it's a client side issue...? – tobyc Jan 14 '09 at 20:24
0

IE8 will let you debug the javascript. AFAIK, what you are explaining should not happen in a typical setup, because the server handles requests from all browsers the same. Are you sure you are sitting on the correct breakpoint, and on the correct page?

Perhaps you could post a small sample of the page_load and where you are setting the breakpoint, and the JS that calls back to it?

For your reference, here is the ASP.NET page lifecycle.

StingyJack
  • 19,041
  • 10
  • 63
  • 122