Reputation:
In my .net 3.5 web app i redirect users to another page using response.redirect.
This works in all ie browsers but not in firefox browsers. i have no idea why?
Response.Redirect("~/"+ GlobalConsts.ARTICLE_ANALYSER_URL +"?"+ GlobalConsts.QUERYSTRING_KEY_ONE +
SessionHandler.RedirectToArticleID + GlobalConsts.QUERYSTRING_KEY_TWO +
SessionHandler.RedirectToArticleParentOrChild);
Upvotes: 3
Views: 4544
Reputation: 1813
Updated
Instead of using Response.Redirect just manually do the redirect:
Response.Clear();
Response.Status = "302 Found";
Response.StatusCode = 302;
Response.AddHeader("Location", url);
Context.ApplicationInstance.CompleteRequest();
Old Post
It might be a caching issue, as according to this article http://www.mrclay.org/2011/07/03/firefox-5-shibboleth-issues/
And you might need to remove any caching headers you are sending along in the response. So set the cache headers to not cache and then response redirect:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Redirect("~/"+ GlobalConsts.ARTICLE_ANALYSER_URL +"?"+ GlobalConsts.QUERYSTRING_KEY_ONE +
SessionHandler.RedirectToArticleID + GlobalConsts.QUERYSTRING_KEY_TWO +
SessionHandler.RedirectToArticleParentOrChild);
Upvotes: 1
Reputation:
Try this piece:
Response.Redirect("~/"+ GlobalConsts.ARTICLE_ANALYSER_URL +"?"+ GlobalConsts.QUERYSTRING_KEY_ONE +
SessionHandler.RedirectToArticleID + GlobalConsts.QUERYSTRING_KEY_TWO +
SessionHandler.RedirectToArticleParentOrChild,false);
Upvotes: 0
Reputation: 7591
you can create a javascript function and call it when redirection needs to be done,
//javascript
function RedirectJS(url){
window.location.href=url;
}
in the codebehind modify the onclick attribute of the button
//C#
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
Button1.OnClientClick = "RedirectJS('"+HttpContext.Current.Request.ApplicationPath+"/"+GlobalConsts.ARTICLE_ANALYSER_URL +"?"+ GlobalConsts.QUERYSTRING_KEY_ONE + SessionHandler.RedirectToArticleID + GlobalConsts.QUERYSTRING_KEY_TWO + SessionHandler.RedirectToArticleParentOrChild+"');";
}
}
Upvotes: 0
Reputation: 36027
Always check with fiddler first.
I like a suggestion made in the forum you linked, about it not being an error with redirections, but an issue with the browser cache. Try setting the expires header.
If the above doesn't do it, share more of your findings with fiddler.
Upvotes: 3
Reputation: 103397
Try installing this Firefox extension and recording the headers that are sent to the client:
https://addons.mozilla.org/en-US/firefox/addon/3829
The headers may give you some more insight into what is going wrong.
Upvotes: 6