View Complete Post
I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.
Additionally, if I "manually" do the redirect, it's fast. For example:
Existing way:
Response.Redirect(url);
takes around 20 seconds on the new server
New way:
Response.Status = "302 Moved Temporarily";Response.AddHeader("Location", url);Response.End();
is fast on the new server.
Any ideas why Response.Redirect would be so slow on the new server?
I need to open a new window with Response.Redirect, Is it possible?
Hello, I will try to be as clear as I can be. I'm sure this question has been asked but I can't find a suitable answer for this particular situation.
I need to be able to redirect the browser to a new 3rd party page while at the same time supplying a cookie required for some form of authentication on the 3rd party site.
I have managed to get this to work in the following manner:
'SessionID is predetermined by another HttpWebRequest/Response Dim sessionCookie As New Cookie("ezproxy", sessionID.Substring(1), "/", ".someother.site") Dim CookieJar As New CookieContainer CookieJar.Add(sessionCookie) rRequest = HttpWebRequest.Create("where I want to go") rRequest.CookieContainer = CookieJar rRequest.Method = "GET" '''' 'Make the request and get the response. rResponse = rRequest.GetResponse() '''' 'Save cookie(s) If (rResponse.Cookies.Count <> 0) Then For Each cook
VS 2005, AJAX
I use gridview and I need single and double click for each row in gridview.
When I click once on a row, some action will execute (e.g. next button should be enabled) and when I double click the row there should be redirection to another page.
I used the code below for both single and double click usage:
protected void GwContainers_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { // Get the LinkButton control in the first cell LinkButton singleClickButton = (LinkButton)e.Row.Cells[8].Controls[0]; // Get the javascript which is assigned to this LinkButton  
ÃÂ'm writing an IHttpModule to catch the 404 error:
public void Init(HttpApplication context) { context.Error += new EventHandler(OnError); }
public void OnError(Object source, EventArgs e) { HttpContext context = ((HttpApplication)source).Context; context.Response.Redirect("~/test.aspx"); }
For some reason the Redirect is completely ignored? (the statement is reached and executed when debugging, but nothing happens)
Thanks in advance
Hi All,
Recently i upgraded to VS2010 RC1 and ASP.NET 4 RC1.
My old code Response.Redirect("~/iSolutions_Home.aspx") worked perfectly fine even in beta 2, however in RC1 the redirect did this:
http://localhost:12250/WinComm_iSolutions_2010/%2fWinComm_iSolutions_2010%2fiSolutions_Home.aspx
and i got the following error:
Bad Request Server Error in '/WinComm_iSolutions_2010' Application. HTTP Error 400 - Bad Request.
Version Information: ASP.NET Development Server 10.0.0.0
Please kindly assist.
Thank you in advance.
Best Regards,
leroylll
Here's the scenario.
I've got a form with a button on it. You have to be logged in to see this form. I use this code to check if the user is logged in and act appropriatley.
Dim isLoggedIn As Boolean = CType(Session("LoggedIn"), Boolean) If isLoggedIn = False Then Response.Redirect("Login.aspx") End If
The button runs a report that takes anywhere from 0.5 to 20 seconds. For testing it just sleeps for 10 seconds.
Threading.Thread.Sleep(10000)
The problem is this. Say User1 comes to the form, logs in and runs the report. If User2 comes to the form, the page will not load until User1's report is done.
Now, the bonus is if I comment out the response.redirect line, everything works fine. But if that line is in there I will get this problem.
My quesiton is why is this happening? What's going on in the background that's causing this? Any way around it?
I have an UpdateProgress control to activate on a postback of a LinkButton control in UpdatePanel. The LinkButton_click event is performing a Response.Redirect to pull up a Downloading. The Download comes up and the UpdateProgress bar is spinning on the page with the button. Either cancel downloading the UpdateProgress image is still there spinning.
1- How can I make the UpdateProgress bar to finish and go away?
2- How can Freez page while spinning loding?
My code is
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Downloads") { int index = int.Parse(e.CommandArgument.ToString()); GridViewRow selectedRow = GridView1.Rows[index]; string cid = selectedRow.Cells[1].Text; DownloadFile(); }
public void DownloadFile() { string directoryString = Session.SessionID; DirectoryInfo folder = Directory.CreateDirectory(directoryString); foreach (FileInfo file in folder.GetFiles()) { file.Delete(); } .. . . string ss = GridView2.Rows[0].Cells[1].Text; string s = GridView2.Rows[0].Cells[2].Text; string filename_path = &qu
Folks,
After Authentication, the Login page gets redirected to Default.aspx.
I am using the below snippet in Login.aspx and javascript below that in the Default.aspx so as to disable the browser back button, which works fine.
Now, if I do a response.redirect on signout, it fails the page to redirect to Login again. How can I overcome this scenario?
<body onLoad="if(history.length>0)history.go(+1)">
<script type="text/javascript"> function noBack() { window.history.forward() } noBack(); window.onload = noBack; window.onpageshow = function (evt) { if (evt.persisted) noBack() } window.onunload = function () { void (0) } </script>
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend