IIS 6 Website Root Vs Application?

Mar 8, 2011

IIS 6
ASP.NET 3.5 (C#.NET)

We are having an issue where the same set of files behave differently depending on if it is a root IIS website versus an application under an IIS website. The urls produced using ResolveUrl() are different - i.e.:

<a href="<%=ResolveUrl("~/contact.aspx") %>">Contact Us</a>

As the root website, it produces: http://contact.aspx

As an application under a website, it produces: http://domainname.org/DSC/contact.aspx

Both are utilizing the same files. The first example is its own website, the second is a virtual directory made into an application (titled DSC). Both also use the same application pool, and same configuration, document and security settings (I made sure all the settings were the same in IIS between both).

Everything that has been researched indicates ResolveUrl() does refer to the IIS application that the webpage is under. I have also read several places that even if the information isnt completed in IIS (in this case it is), a root website is considered an application. Therefore, it should produce the appropriate web address, but isnt.

View 1 Replies


Similar Messages:

Web Forms :: ScriptManager Uses Website - Root Instead Of Application Root Directory

Jan 27, 2010

I ran into the following issue when trying to run a test website on IIS 7.5 (Windows Server 2008 R2 DatacenterEdition). The web-app is configured to run with framework version 3.5 in a .Net 2.0 app pool. Also the framework 4.0 beta 2 is installed on the server. The application named 'TestPfade' is located under the website's root named 'Default'. It is not only a virtual directory but defined as an application. The folder structure looks like this: The markup of the sole document reads as follows:

[Code]....

When viewed in a browser the image gets shown because the given relative path is correctly resolved to 'images/Lighthouse.jpg' but the paths to the ajax-framework resources also include the application's root folder and therefor aren't found: 'src="/TestPfade/WebResource.axd?d=1bX...' Here is the complete html-source generated:

[Code]....

View 9 Replies

Request The Root Default.aspx Without Specifying It In The Url For Your Root Application?

Sep 17, 2010

How can you request the root default.aspx without specifying it in the url for your root application?e.g. ttp://localhost/MyApp/ instead of http://localhost/MyApp/Default.aspxshould be able to do bothI'm not sure if this is a setting in IIS 7.5 for the application or what.

View 3 Replies

How To Change Website Root

Jan 19, 2011

I am URL routing myself.

Main project only contain the URL routing code.

Different websites are placed on approot.

e.g: I have deployed VS2010 test-default-website at approot/webTest/.

I am trying to opening [URL] from browser.

For that URL request, I am serving page using PageParser.GetCompiledPageInstance(), as follows:

In URL route request handler,

return PageParser.GetCompiledPageInstance("webTest/Account/Login.aspx", HttpContext.Current.Server.MapPath("webTest/Account/Login.aspx"),
HttpContext.Current);

I am getting following exception:

The file '/Account/webTest/Account/Login.aspx' does not exist.

PageParser.GetCompiledPageInstance is automatically appending '/Account' before the actual address, thus unable to find it.

How can I make it not to append '/Account' ?

View 1 Replies

Running A Website From The Root?

Jan 9, 2010

I have an ASP.net Website. the project' content is in a folder called MyWebSite. When I run my application from Visual Web developer 2008, the browser displays the following address in the address bar: http: // localhost/ MyWebSite /Default.aspx

I want to be able to run my Website from the following address:

http://localhost/

View 3 Replies

Configuration :: Iis 7 - How To Host The Website At The Root

Jul 9, 2010

I've followed this link [URL] to configure my application on iis7.

- I've published it

- create a folder in inetpubwwwrootMyApp

- I've created my virtual directory to point on MyApp

but then to log on it, I need to point on http:\localhostMyApp but i would like to point on http:\localhost

View 1 Replies

Web.Routing For The Website Root Or Homepage?

Apr 1, 2010

I am doing some work with Web.Routing, using it to have friendly urls and nice Rest like interfaces to a site that is essentially rendered by a single IHttpHandler. There are no webforms, the handler generates all the html/json and writes it as part of process request.

This works well for things like /Sites/Accounting for example, but I can't get it to work for the site root, i.e. '/'.

I have tried registering a route with an empty string, with 'default.aspx' (which is the empty aspx file I keep in my root folder to play nice with cassini and iis). I set RouteExistingFiles to false explicitly, but whatever I do when hitting the root url it still opens default.axpx, which has no code it inherits from, and contains a simple h1 tag to show that I've hit it.

I don't want to change the default file to redirect to a desired route, I just want the equivalent of a 'default' route that is applied when no other routes are found, similar to MVC.

For reference, the previous version of the site didn't use Web.Routing, but had a handler referenced in the web.config that was perfectly capable of intercepting requests for the root or default.aspx.

Specs: ASP.NET 3.5sp1, C#, no webforms, MVC or openrasta. Plain old IHttpHandlers.

View 1 Replies

C# - How To Select A Folder Relative To Root In Website

Jul 29, 2010

I am trying to select all the files from a folder in my website and store them in a collection. The problem is that when I run the website it is not selecting the folder in my website:

This is the basic structure: [Root Folder] --> [FilesFolder]

Here is the code I am using:

DirectoryInfo dir = new DirectoryInfo("FilesFolder");

But it is showing this at runtime as the location of the folder:

C:Program Files (x86)Common FilesMicrosoft SharedDevServer10.0FileUploads

Is there a way to select the folder relative to the root of the website?

I am using C# with ASP.NET 3.5

View 2 Replies

Web Forms :: Find The Root Path Of Website?

Jan 3, 2010

I want to find the root path of my asp.net website.

Im using Request.PhysicalApplicationPath right now which looks like this:

F:CasperMy DropboxDotNetPortfolioV2 (Which is good)

But if I go to a folder it will be:

F:CasperMy DropboxDotNetPortfolioV2FolderName (Not good)

I just want the root.

View 2 Replies

C# - Saving Files In The Root Website Directory In Apache

Jul 16, 2010

I have an ASP.NET application running on Apache server with mod_mono. If I have a folder called "temp" located in the website's root directory and run the following code

System.IO.TextWriter tw = new System.IO.StreamWriter("temp/test.txt");
tw.WriteLine(DateTime.Now);
tw.Close();

it saves test.txt in C:Program FilesMono-2.6.4in emp on the server. If I add a slash to the directory name like this: System.IO.TextWriter tw = new System.IO.StreamWriter("/temp/test.txt"); It saves it to C:/temp. Both do not do what I want. How do I get the code to save the file to the temp folder inside my website's root directory? Is this a mod_mono issue or something to do with Apache? I have tried adding this line to httpd.conf Alias /temp "C:/Path_to_root_folder/temp" without any luck. I shouldn't have to use alias if the temp folder is within the root directory, correct? In my development environment which uses XSP as the web server everything works as expected. It is only a problem when running on Apache.

View 1 Replies

Addressing From The Root Directory Of Website In Action Script

Oct 30, 2010

I have a flash banner in my website and it has some navigation links on it. Because I have several different folders in my website I need address them from the root. At the moment i use getUrl like this: getURL("ArticleList/Default.aspx"); But it doesn't work .

View 2 Replies

Configuration :: Access To Files In Website Root Via Subdomain

Jun 9, 2010

folders in my website root are

a
b
c

I have subdomain "s1" which points to "a" folder. I want to know how could I access to files stored in "b" folder form subdomain "s1". My issue is that files I have some html content which saved in DB Records and their path are base on webroot i.e. "<img src="/b/movie1.avi" /> .Could any one tell me how I could show these files via subdomain "s1"

View 1 Replies

Web Forms :: No Default.aspx In The Root Of Website Project?

May 27, 2010

i have a website project. i have 2 folders within default.aspx. in the root i have no default.aspx.

How can i redirect users when they are in Role "Folder1" to the ../Folder1/default.aspx
and user in Role "Folder2" to the .../Folder2/default.aspx

View 2 Replies

Default Behaviour Is Sending The User To The Website Root?

Sep 16, 2010

Is it possible to control the behaviour of ASP.NET when the Session has expired? It seems that the default behaviour is sending the user to the website root. The desired effect would be to send the user to a custom "Session Expired" page.To clarify, it's the SessionState that's expiring (set the timeout to 1 minute to quickly test it):

<sessionState mode="InProc" timeout="1"></sessionState>

The authentication cookie timeout is way higher, to avoid any mix-up:

<authentication mode="Forms">
<forms loginUrl="SessionExpired.aspx" slidingExpiration="true" name=".ttpASPXAUTH" timeout="58" protection="All"></forms>
</authentication>

View 2 Replies

Data Controls :: Image Folder Outside Root Website

Dec 27, 2011

I had a look at Displaying images that are stored outside the Website Root Folder

View 1 Replies

Way To Pass The Root Url To The Flex Application?

Feb 21, 2011

I am working on a project that is primarily ASP.NET based. The main project is meant to be deployed to multiple locations for different clients, so one client might be located at website.com/client1 and another at website.com/client2. Within the application, we regularly use the application root operator ~ to get the path to a resource.We also have a bunch of Flex applications that get deployed in there, and many rely on web services within the ASP.NET application. What I'm after is a way to reference the services relative to the application root. Here's an example of the location of some files for two client deployments:

Client A
website.com/clientA/swf/FlexApplication.swf
website.com/clientA/services/webService.asmx
Client B
website.com/clientB/swf/FlexApplication.swf
website.com/clientB/services/webService.asmx

FlexApplication and webService are both exactly the same, so what I want to do is something like this in the Flex code:

var myService:CustomService = new CustomService(~/services/webService.asmx);
myService.callMethod("Test");

I would like to avoid using relative paths for the usual reasons. Is there a good way to do this or a good way to pass the root url to the flex application from ASP.NET?

View 3 Replies

Configuration :: Application Root - Local IIS?

Oct 15, 2010

I recently got abused on these forums because I was testing with the cassini in my development environment. So now I use local iis via the settting in the properties --> web tab and then creating a virtual directory.

The problem now is that the url is:

http://Localhost/Website

The problem is that http://Localhost/ is still the root - so its gone and broke all my css and JQuery ajax calls.

I've tried playing with application root setting in the properties tab with no luck. I have been querying the interwebs and realise that I need to do something in IIS -

View 3 Replies

Include Javascript From Application Root?

Jul 30, 2010

How do I include a javascript using ~/ expression? It works with <asp:Image>, I don't know how to do the same thing with javascript.

View 3 Replies

Web Forms :: Access Text File In Website Root Folder?

May 27, 2010

In Visual Studio I added a text file Example.txt to the root folder of my web site (where Default.aspx exists).

Later in C# code I reference this file :

string text = File.ReadAllText("~/Example.txt"); // also tried without the ~/

During runtime, both debug and non-debug, I get an error at this line of code:

C:Program Files (x86)Common FilesMicrosoft SharedDevServer10.0Example.txt'.

So, how should I reference this file?

View 2 Replies

Remove The App_offline.htm From The Application Root Directory?

Sep 18, 2010

I get the message "This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory. "

However, this is no app_offline.htm file in the root directory. Where in the heck is it?

I am looking in the Solution Explorer, and I also looed in Windows Explorer . . . not a sign of it. ?

View 4 Replies

Specify The Application Root In Web.config Handler Mapping?

Mar 14, 2011

I have an application with an HttpHandler that processes any requests for a .js file. I only want this handler to process *.js files that are requested in the root of the application.

The handler mapping looks like this:

<add name="HandleJS" path="*.js" verb="*" type="MyApp.JsHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />

Currently, this handler processes ALL requested *.js files. Here is an example of the behavior I want.

This request would be processed by the handler: http://localhost/myapps/approot/script.js

and this one would not be processed by the handler: http://localhost/myapps/approot/dontProcessMe/script.js

I'd really like to avoid including the full absolute path in the handler path so I tried some other things first.

It doesn't look like the path property of the add element allows the use of the ~/ application root mechanism, so setting path="~/*.js" doesn't work.

I've also tried replicating the StaticFile handler that's built into IIS and doing something like this:

<add name="MyStaticFiles" path="*/*.js" verb="*" modules="StaticFileModule" />

or

<add name="MyStaticFiles" path="dontProcessMe/*.js" verb="*" modules="StaticFileModule" />

Both of which just return a blank response with an HTTP status of 200.

View 2 Replies

Taking Path From Application Root In JavaScript?

Sep 7, 2010

[code]...

I have write a javascript function loadPage(), that needs a path to some page as a parameter. I need to give this path from the application root. I dont want a relative path.

View 2 Replies

Access :: Want To Keep The Database In The Root Folder Of Application?

Oct 29, 2010

i want to keep the database in the root folder of my application.what would be the connection string ?

View 1 Replies

VS 2010 - Homepage Won't Load Unless Specifically Type Filename Into Root Of Website

Oct 11, 2012

I'm not sure what I did to cause this but my website homepage won't load unless I specifically type the filename into the root of the website - i.e. URL....works but URL... doesn't. It could be something I changed in the web.config or the project properties.

View 2 Replies

Use Default.aspx In Root Folder To Redirect To Application?

Aug 19, 2010

How can I setup the code in default.aspx to automatically direct the user to the default page for the application. If the user types the server name as in http://MyIntranet, I want them to be redirected to [URL]

[Code]....

IIS threw back the error that the operation requires IIS integrated pipline mode, which obviously isn't available because we're running IIS6.

View 3 Replies







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