Would A Browser Ever Ignore Case Sensitivity Of The Location Header When Responding To A Redirect

Sep 3, 2010

If a browser requests http://site.com/?q=abc

and gets a 301 redirect response to location http://site.com/?q=ABC (note case of querystring)

Is it possible for the browser to ignore the difference in case and re-request http://site.com/?q=abc, thus causing an infinite redirect loop?That's the scenario that appears to be happening according to the IIS logs. It seems to be isolated to Internet Explorer with some variation of the Ask toolbar installed (based on user-agent values). I even installed the Ask toolbar, but have not been able to recreate this scenario in any way.

I can't post the source code, but for those that want something, here's the general logic:

Page_Load(object sender, EventArgs e)
{
var q = Request.QueryString["q"];[code]...

As you can see, if this page is requested with ?q=abc it will be redirected once, but then it'll render as usual because the redirect goes to ?q=ABC.Is there any scenario where the browser (specifically IE with the Ask toolbar) could ignore the case of the redirect location, causing an endless loop?

View 2 Replies


Similar Messages:

Active Directory :: How To Specify Case Sensitivity In The LDAP Query

Mar 22, 2011

I am very new to AD and querying it. If you can, how do you specify case sensitivity in the LDAP query?

I have a series of methods that convert a lamda expression into an LDAP query but i don't know the syntax for case-sensitive searching.

The field it is searching is case-insensitive but as it is a base attribute i don't want to modify it.

View 8 Replies

C# - Remove Case Sensitivity From FormsAuthentication.Authenticate Of User Name/password?

Jul 5, 2010

The below code and the config works fine, but force to enter user name/password case sensitively, i want to make it non case sensitive.

Code:

protected void LoginButton_Click(object sender, EventArgs e)
{
try
{
string uid = UserText.Text.Trim();
string pwd= PwdText.Text.Trim();
if (string.IsNullOrEmpty(uid) ||
string.IsNullOrEmpty(pwd)).....

View 3 Replies

C# - Ignore Case When Data Binding To SqlDataSource?

Mar 16, 2011

I have a DropDownList which binds its SelectedValue to a field from an SqlDataSource. However, I need it to ignore the case when data binding, as if it's not in the correct case I recieve a lot of errors. Is this easily achievable?

View 1 Replies

Why Does IIS7 Ignore Content-type Header When Use Stream Files

Feb 9, 2010

I have a simple web site with two pages. One displays a list of files, and the other streams a file when it's clicked in the list. All was fine in production for 6 months, but now I have to move the site to Windows 2008/IIS7. I have it mostly working, but the files don't open properly (in Firefox) because my content-type header is being ignored. On the production site (IIS6) the headers are (using Fiddler):

HTTP/1.1 200 OK
Date: Tue, 09 Feb 2010 16:00:51 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Content-Disposition: attachment; filename="myfile__foo.pdf"
Content-Length: 236841
Cache-Control: no-cache, no-store
Pragma: no-cache
Expires: -1
Content-Type: application/octet-stream

but on the test IIS7 server I get:

HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 236841
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
Content-Disposition: attachment; filename="myfile__foo.pdf"

Fiddler also reports a protocol violation and says "Content-length mismatch: Response Header claimed 236841 bytes, but server sent 238378 bytes."

My code looks like this:

[code]....

View 1 Replies

How To Ignore A Http Request Without Clearing The Browser

Mar 24, 2010

To prevent duplicate requests (i.e. pressing F5 right after clicking a command button), I've setup my page base class to ignore the request if it's detected as a duplicate.

When I say 'ignore' I mean Response.End()

Now I thought I've seen this work before, where there's an issue, I just Response.End() and the users page just does nothing. I don't know the exact circumstance in which this worked, but I'm unable to repeat it now.

Now when I call Response.End(), I just get an empty browser. More specifically, I get this html.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD>
<BODY></BODY></HTML>

I setup the following test app to confirm the problem is not elsewhere in my app. Here it is:

Add the following to an aspx form

<asp:Label ID="lbl" Text="0" runat="server" /><br />
<asp:Button ID="btnAdd1" Text="Add 1" runat="server" /><br />
<asp:Button ID="btnAdd2" Text="Add 2" runat="server" /><br />
<asp:Button ID="btnAdd3" Text="Add 3" runat="server" /><br />

And here's the code behind file

using System;

namespace TestDupRequestCancellation
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Init(object sender, EventArgs e)
{
btnAdd1.Click += btnAdd1_Click;
btnAdd2.Click += btnAdd2_Click;
btnAdd3.Click += btnAdd3_Click;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
CurrentValue = 0;
else if (Int32.Parse(lbl.Text) != CurrentValue)
Response.End();
}
protected void Page_PreRender(object sender, EventArgs e)
{
lbl.Text = CurrentValue.ToString();
}
protected int CurrentValue
{
get
{
return Int32.Parse(Session["CurrentValue"].ToString());
}
set
{
Session["CurrentValue"] = value.ToString();
}
}
void btnAdd3_Click(object sender, EventArgs e)
{
CurrentValue += 3;
}
void btnAdd2_Click(object sender, EventArgs e)
{
CurrentValue += 2;
}
void btnAdd1_Click(object sender, EventArgs e)
{
CurrentValue += 1;
}
}
}

When you load the page, clicking any button does what is expected, but if you press F5 at any time after pressing one of the buttons, it will detect it as a duplicate request and call Response.End() which promptly ends the task. Which leaves the user with an empty browser.

Is there anyway to leave the user with the page as it was, so they can just click a button?

Also; please note that this code is the simplest code I could come up with to demonstrate my problem. It's not meant to demonstrate how to check for dup requests.

EDIT: Another change that will allow me to achieve the same results would be to disable all my event handlers.

View 3 Replies

Web Forms :: Open New Window And Redirect Current Location

Oct 26, 2010

I have a page that creates a pdf and opens the pdf. I use response.write with javascript using window.open to make the window open with the pdf, works fine. I then want the main window to do a redirect to a message page. But soon as I add code to do that (either more javascript using location.href or response.redirect, it does that but the window.open no longer works. It's like it's running the redirect before it really has a chance to finish the window.open. Is there a better way (a way that works LOL) to accomplish this?

View 2 Replies

Root Path With Tilde - Doesn't Change Upper Case To Lower Case

Dec 30, 2010

I have my project set up with the virtual path "/MyVirtualPath", create the virtual directory in IIS 6 (W2003) and everything works fine. Then to work better with Google Analytics I change the virtual path "/myvirtualpath" and change all redicecciones and links to lowercase. also applies the class "lowercase route urls in aspnet mvc" and works perfectly.

The problem I had to modify the virtual directory in IIS, delete virtual path "/MyVirtualPath" and I created the new "/myvirtualpath", but in all cases I use tilde "~" or where I make a "RedirecToAction" (which should take "LowercaseRoute"), continues to maintain the virtual path "/MyVirtualPath". For example, if I see the HTML source code in the browser, see "/MyVirtualPath/Content/Site.css" instead of "/myvirtualpath/Content/Site.css. "

View 1 Replies

User Controls :: How To Browse Folder Using Browser Button From Any Location On Server

Apr 17, 2012

i'm creating a asp.net web application in which i need to select source file using browse button to select the Source location from where the files has to be copied from and destination file using browse button to select the destination location where the files has to be copied to .So pls tell me what should be the code for browse button to browse a folder for source and destination and copy the source folder files to destination folder(i want to copy only text and excel files from source to destination folder) and i want user to see the progress how files are copying from source to destination and error also if there is any error in copying.

View 1 Replies

Security :: Redirect To Main Log In Page If Fail Log In From Header Bar

Mar 6, 2011

I have a stripped down log in form on the top of each page, user/pass box and buttom, no keep me log in or error messages. If the user enters the right credetians he is log in and user name shows up instead of log in form; if he enters the wrong info, nothing happens.

Now, I want it to happen is that if the user enters the wrong credetians, and he doesnt get log in, he is redirect to the full Log In page.

View 4 Replies

AJAX :: Accordion Header Should Redirect To New ASPX Page

Mar 6, 2010

In my MASTER.PAGE I have placed an Accordion Extender. If I click on the HEADER, I want to open the Accordion and redirect to another ASPX.Page, which is a child of the MASTER. How can I do this? If have already placed HyperLinks inside the Headers like this:

[Code]....

The first problem is, that Product2.aspx is only loaded, if I click exactly the Link. If I click somewhere else in the Header, the accordion will expand but the Link is not fired. The next thing is, if I click exactly on the Link, the new page is loaded, but the Accordion is set back to the default view (first AccordionPane is expanded) Is there a way to get this done?

View 2 Replies

Redirect ALL Ajax Requests(with X-Requested-With:XMLHttpRequest In Header) To Action?

Sep 16, 2010

i want redirect ALL ajax requests(with X-Requested-With:XMLHttpRequest in header) to action: ajax(string function, string args) . How can i do it?For example: browser send ajax query with paramerts function=getImage&args=4 to url http://localhost/post/123 but we redirect query to http://localhost/ajax.

View 2 Replies

Web Forms :: Lock Gridview Header In IE8 Browser Normal View?

Mar 29, 2011

I am using IE8 browser. I would like to Lock column header of gridview in IE 8 Normal View. I can lock in In compatibility View . I could not Lock In Normal view of IE8 Browser. I have developed Asp.net Application(c#) usingNote: Gridview column Header is dynamically loaded as per Client Requirement.

View 1 Replies

Response.Redirect In New Browser Window

Aug 31, 2010

protected void ddlPrint_Changed(object sender, EventArgs e)

View 4 Replies

Web Forms :: Clear IE Browser Pagesetup - Header And Footer Using 1.1 Dotnet Framework

Aug 16, 2010

I like to clear the IE Pagesetup--> header and footer using Asp.net 1.1 , I have tried in 2.0 Dotnet it works fine it is not working in 1.1 and its urgent too this is the code i tried ...........

public void IESetupFooter()

View 2 Replies

Web Forms :: Response.redirect Causes Browser To Hang?

Feb 18, 2011

I've created a new web application in Visual Studio 2008. Then I added a button, and in the Button1_Click event I put a redirect statement to a website. This is the only code I've added to the default app. But when I run this application on my development server and click on the button, a browser window opens and then permanently hangs without showing the page content.This is a simplified version of a problem I'm having in another app. I can't get past this. Why does this resonse.redirect statement cause the browser (I'm using IE8 and Windows Vista) to hang?

Protected
Sub Button1_Click(ByVal
sender As
Object,
ByVal e
As EventArgs)
Handles Button1.Click
Me.Response.Redirect("http://www.microsoft.com")
End
Sub

View 2 Replies

How To Replace Request To PDF File To Redirect To Same File In Different Location

Dec 7, 2010

I have a virtual web folder that has large number of PDF Files (Leave Forms) submitted over the past 5 years.

The users and other applications have direct references to such files and on some cases, the PDF is referenced as embedded object.

Here is a snapshot of where the PDFs are stored:

So, the direct link to the PDF will look like the following:

[URL]

Becuase the PDFs are stored under a folder under the ASP.NET Web Application, it was a bad idea.

Now, I have to move them all to another location which is simply a virtual folder outside the Web Application.

All Leave PDF Forms have Unique URLs which is:

"SessionID" + "/" + "Leave-userid-start-date.pdf"

So, I need to replace the above link with the following after I move the PDF Files. I want the replacement to happen at the time it is requested from the Client Browser. The new URL will look like the following:

[URL]

So, whether it is requester from IE from any other Object Tag or similar, then the input URL should be replaced with the new URL as shown above.

View 4 Replies

Forms Data Controls :: Freezing Datagrid Header - Cross Browser Solution?

Jan 12, 2011

I have a datagrid and vertical-horizontal scrollbars in it. now when datagrid will have more records , scoll bars will be provided. now when i scroll vertically , my header line of the datagrid is also scrolling so i wanna freeze it. i have used javascript to freeze it , its working in IE properly but there is problem with other browser.

i used this :[URL] but its not working in other browser.

View 11 Replies

Redirect / Remove QueryString But Don't Create History In Browser

Aug 19, 2010

I'm looking for a way to get rid of the querystring of a page and redirect to itself but preserver the querystring data in some way. Exmaple: [URL] should redirect to [UL] Still, after the redirect, I want to be able to pick up the parameters that were originally passed. And I don't want to have [URL] in the browser's history.

What I tried so far:

* Response.Redirect(): does a proper redirect without creating browser history but I cannot preserver the parameters.
* Server.Transfer: preserves the parameters but the browser's URL remains unchanged.
* Create a client form on the fly and submit in "onload": works, querystring is gone, parameters are accessible through Request.Form, but creates a history entry in the browser.

The only thing I can currently think of is to store the parameters in the session, then redirect, then pick them up from there.

View 2 Replies

Cross Browser - Is It Possible For Clients To Disable/disregard A 301 Redirect

Jan 23, 2011

I have 2 domains that resolve to my web site www.mysite.com and www.mysitecommonmisspelling.com, plus the IP address. I have some code in my Global.asax file that was intended to force all users and crawlers to only use the main domain, like so:

Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs)

'If the domain isn't the correct top level domain for this environment,

'we want to do a 301 redirect to tell the search engines that this is not the right domain to

'index.
Dim Host As String = Me.EnvironmentHost
Dim CurrentHost As String = Request.Url.DnsSafeHost[code]....

I checked and Google has not indexed any pages on www.mysitecommonmisspelling.com, so they are apparently respecting the 301. However, a few days ago we had a customer on our site who got free shipping because the licensing code that is only registered for www.mysite.com failed (in other words, the browser was able to access www.mysitecommonmisspelling.com). In the past, we have had issues with the 3rd party shipping component because users were able to access the site using the IP address.

In any case, we don't want users to be able to access the site without the correct domain so the SSL certificate doesn't complain.

I have searched for a way to disable 301 redirects in IE7, but there doesn't appear to be a way. So, what I am wondering is if there are any browsers that can disable 301, and if so what kind of workarounds can I put in place to ensure all browsers on my site are going to the main domain, www.mysite.com?

View 1 Replies

Web Forms :: Webpage Has A Redirect Loop In Chrome Browser

Jun 16, 2015

While im trying to execute the asp page, im getting this error,"This webpage has a redirect loop".

View 1 Replies

C# - How To Browser Occasionally Losing HttpCookie For Authentication After Postback And Redirect

Dec 29, 2010

This has been a nagging issue for some time, but very sporadic and difficult to isolate.

From time to time, browsers that have authenticated on a web application, have been open for a while, have logged in and out of the same web application multiple times, have multiple tabs, are pretty much any browser (Chrome, IE, Firefox, Safari), and seemingly at random, lose their ability to retain an AuthCookie after being set and followed by a redirect. Closing the browser and starting a new session resolves the issue, as does opening up a different browser and attempting to authenticate.

Our team uses forms authentication for all of our websites and web application. This is a pretty typical setup where a login form is displayed, the user enters credentials and a cookie is set on the click event of the postback, then a redirect occurs to the same page where the cookie is then referenced and used to complete authentication.

In this situation

FormsAuthentication.FormsCookieName = ".WebAuth"

Within Event:

FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, Username, DateTime.Now, DateTime.Now.AddMinutes(SessionTimeout), false, Username); HttpCookie faCookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(authTicket));
Response.Cookies.Add(faCookie);
Response.Redirect(Request.RawUrl, true);
After the redirect, on PreInit:
HttpCookie authCookie = Request.Cookies[cookieName];

At this point, the authCookie variable is typically not null, but in these isolated circumstances that I've outlined above, the cookie comes back null after the redirect.

This happens very randomly, sometimes weeks before affecting one of our developers. As I said, restarting the browser resolves the issue.

Today I had it happen on our dev server while using Chrome. I had logged into the application, allowed the application to session timeout, and then attempted to login again. The attempted login then failed to set the cookie. I remotely attached Visual Studio to the process on the server to begin debugging. The entire time I could step through my code, even deploy new code versions to the server with updates, restart the app, restart IIS on the server, attach and reattach to the project, and the issue persisted in Chrome. In Firefox, I was able to authenticate without issue.

From Chrome, the login would validate, attempt to set a Response Cookie as outlined above. Prior to redirect, I could see the properly set Response Cookie, as well as its counterpart in the Request Cookies. However, on each redirect after a seemingly successful login, the Response and Request Cookie are gone.

I enabled Trace on the application to view the cookie collection:

There is a .WebAuth in the Request Cookies Collection, as well as ASP.NET_SessionId and several ASPSESSIONIDxxxxxxxx, but when the page loads, only the ASP.NET_SessionId and ASPSESSIONIDxxxxxxxx cookies are available in the Request.Cookies scope, no sign of the .WebAuth. However, in the page's Trace information after render, there multiple .WebAuth cookies listed, it is just that the page seems to have no access to them.

Primarily, on a working version after authentication there is both a .WebAuth Response and Request Cookie in the page's Trace info. But on a non functioning browser window, the Response Cookie is absent.

Has anyone else had any experience with this? It is such a nagging issue, and so sporadic, but I would love to be able to resolve it. My concern is that it may be affecting users and we would have no knowledge since the description of the issue is so convoluted.

View 1 Replies

Social Networking :: Get Distance From Current Location To Destination Location Google Map

Mar 26, 2016

URL....This link shows a demo that let user to put origin and destination then get direction. I want to know how to add a option which is let user to use their current location as origin location (Location from).

View 1 Replies

Forms Data Controls :: Want To Have Hyperlink Or Button In The Links Location In The Transcript Location Fields

Apr 7, 2010

I have a table in my database, in which a certain field holds the locations of text or doc files (the files are of a transcript for a chat session).

In the Gridview right now i able to show the link locations. But i want to have Hyperlink or Button in the links location in the Transcript Location fields.And on the click of which the txt or doc file opens up in notepad or microsoft word.

View 2 Replies

Social Networking :: Draw (Plot) Route Between User Location And Specified Location On Google Maps V3

May 7, 2015

Following is my code when user enters hospital name and city, he will be navigated to this page to show location on map. Now I want to get user current location and draw the route between current location and destination. Is there any way to integrate to geocoding and geolocation?  

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style>
html, body, #map-canvas

[Code] ....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved