ASP.Net when post back get The specified URL cannot be found - asp.net

When clicking the save button on a asp.net web form page, I get the following immediately:
The specified URL cannot be found
This does not happen when I try this using a browser on the web server.
Has anyone run across this problem before? Is this some kind of security issue?
More information. I tried a test page that included all of the form fields and a button that didn't do anything but write to a log4net log. Same problem on the button click. This is just weird.

Found the solution to this!!! Turns out the firewall was blocking request that had more then 40 parameters in the query string.

Could you provide a bit more information?
This could be caused by a lot of things:
Is IIS configured properly for the site? Authentication, host header settings?
Did you try http://localhost/.. on the webserver or did you use the webserver's host name?
Are you redirecting the user? What are you doing in the button event?
Are you using URL routing? Or a handler that might be causing problems?
What version of the .NET framework are you running? 1.1 / 2.0 / higher?
Does the page include javascript that could cause unexpected results?
Checked for crazy stuff in your web.config?
Sometimes it's a good idea to take a step back and create a new ASPX page and test if that one works. Start from a predictable scenario and move towards your current scenario in baby steps.

Related

How to track url redirects in .Net Application?

When I type http://example.com/load/ in my browser and press ENTER, this website redirects me to several URL's and then I finally landed on http://example.com/load/3/.
These redirection happens at the website end, and I finally landed on this last URL. I know by using firebug or fiddler I can get all these related url's.
But I need to get all these related URL's through my .Net application. Because iam working on an application which should do all the jobs as firebug does. thereafter I need to check the status of each URL's from my application.
Need help to get this code?
Since you need to track these url using your .NET application you can use
HttpRequest.UrlReferrer Property.
Another suggestion would be using
http_referer ex(string referer = Request.ServerVariables["HTTP_REFERER"];)
Take a glance at Page.PreviousPage Property too.

Hybrid ASP.NET/MVC application on IIS 7.5 .aspx pages not loading

I have a hybrid ASP.NET/MVC 2 application that is currently hosted on II6.
I need to migrate this to IIS 7.5 and I'm having trouble getting it to work.
The furthest I've got is when the app pool is in integration mode, I migrated the web.congig using AppCmd.exe but only the MVC part worked and the .aspx pages wouldn't load.
I suspect that this is due to a custom handler that somone wrote called StaticFileHandler.
I know that this code is being hit as I see it in the log file.
And also checking the IISLogs I can see that the request returns a 200 http code
I've search around for answers but the only one I found that came close was someone who had their .aspx pages working and not their MVC part.
Has anyone got an idea what I can try?
I've been looking into this for days and havn't come up anything.
Thanks in advance.
I figured this out.
The issue was due to modules in the website.
These were doing things like compression and such, once taken them out, and removing them from the web.config, I got it working rather easily.

HTTP Error 503 - But only when using domain name to navigate

I am currently having a strange issue that has taken me by surprise, I have not had the issue before and I have no idea why I am getting it now.
I have an asp.net mvc 3 website which has a number of controllers all with actions. It is important to note that this issue is only present with one controller and the problem is with all Actions.
The error I am getting is "HTTP Error 503. The service is unavailable."
However, this error only occurs if I browse to the page using the domain name, for example...
subdomain.example.com/controller
but everything works fine if I browse with the ip address and port number...
xxx.xxx.xxx.xxx:xxxxx/controller
remember all other controllers work fine regardless of the method used to browse.
I have tried looking for answers to this and trying to find any useful logging information but have found nothing of use. Hopefully somebody here will have seen this issue before
Ok I have created a sample mvc project with a Reports controller that works so I don't believe it is a problem with MVC.
I'd reccomend looking at your routes and your web.config and make sure you don't have anything intercepting it there into an httphandler or module. Then I'd look at the IIS instance and check for virtual directories. You pretty much are trying to figure out where exactly it is failing - is it even reaching ASP.Net?
One last option to look into is your company proxy - does going to the URL directly go through the proxy? I know at my company this can happen - so there may be a rule there that is intercepting it.

Why do Asp.net web project have garbage values in the url?

I have tried googling and searching for this issue on SO - but have had little success - primarily because I am not sure whether I am searching right.
I am working on an ASP.Net Web Application Project (not website) using Visual Studio 2008, C# and Cassini for testing.
However, everytime I run the site, I get a URL such as:
http://localhost:8671/(S(saifdk55xyhalrqbstrtrdiw))/SubjectClassTeacher/Default.aspx
Even if I modify the URL and try to go to:
http://localhost:8671/SubjectClassTeacher/Default.aspx
I am redirected back to this URL.
The garbage value in the center: (S(saifdk55xyhalrqbstrtrdiw)) keeps changing every few times I compile and I have no idea why it gets injected or how to disable it.
Could anyone throw any light on this issue?
Primarily, I would like to know why this happens and how do I disable this.
Because this happens when I deploy the website on IIS as well.
Any help is appreciated.
Thank you.
This is a clever feature in ASP.NET* called cookieless sessions. It works by injecting your session ID into every URL, so ASP.NET can tell the difference between user A who visits a page, and user B who visits the same page. Normally this is accomplished with cookies, but this approach removes the dependency on the end-user having them enabled.
From MSDN:
...you don't have to change anything in your ASP.NET application to enable cookieless sessions, except the following configuration setting.
<sessionState cookieless="true" />
*The concept is not exclusive to ASP.NET, but it is baked into ASP.NET and - as you've discovered - can be turned on with no particular effort on the part of the developer.

My VB.NET Website Hangs For A Long Time Then Displays Nothing

Okay, this is a weird issue that I've been having with a recent project I'm undertaking.
Occasionally, my website will stop functioning and anytime an ASP page is accessed, the browser will hang for many minutes before bringing up a correctly formatted HTML page with nothing in the tag. It seems to happen whenever more than one person attempts to access an ASP page, but I'm not positive it's isolated to those conditions.
Let me emphasize that the issue does not arise when accessing directories/HTML pages/other files. Only ASP pages are the problem. I am using lunarpages as a host.
My question is: Does anyone have any prior experience with such an issue, and if so, what are some ways to mitigate it?
Thanks in advance - let me know if I can provide any more pertinent information.
It sounds like it may be an issue with your Web Server. Do you have the correct version of .Net installed? Is your Web Server setup to host Asp.Net?

Resources