Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Page_Load called in Firefox, but not IE

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

like image 611
tobyc Avatar asked Nov 26 '25 10:11

tobyc


2 Answers

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);
}
like image 114
tobyc Avatar answered Nov 28 '25 00:11

tobyc


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

like image 40
John Hoven Avatar answered Nov 27 '25 22:11

John Hoven



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!