web site hosting as application in IIS 7 - iis-7

I have an web Application. My application work properly when i hosting as site(www.example.com). But when try to host as a application under my site (www.example.com/everway) css file & javascript (window.location.href) not work.

Your asset URLs when hosted at www.example.com/everway would look like www.example.com/everway/javascripts/application.js, right?
www.example.com/javascripts/application.js and www.example.com/everway/javascripts/application.js are not the same.
Does your application account for that difference?

Related

Is it possible to inject html footer from IIS for all site?

I have a iis 8 server running in windows server 2012. Currently 3 different websites are running on it and the other two will be integrated shortly. All 5 websites are being managed from their respective owner. I want to append 'hosted at xxxx' at the bottom of all pages that is being served by this iis. I can do it application wise is global.asax, but is it possible to do that at iis level, so that I donot edit the hosted application? All websites are in .net 4 and form based.
Yes, you can write an IIS Module that will inject HTML into the HTTP Response Stream. You can add this Module to each application individually by dropping the DLL into the app's BIN folder and registering it in the Web.Config. Alternatively you could create a Strong-Named Assembly and register it with IIS for all sites.

My Website displaying big IIS7 screen when access

We have taken a domain for our asp.net application. That application is deployed in our server (IIS7).. when we are trying to access that website its showing one big IIS7 screen..
can you pls let me know the issue.
Regards,
Abhi
Is your application definitely deployed at the root of the website in IIS or is it deployed as a virtual directory?
Because this is the behaviour I would expect if it is deployed as a virtual directory.

Silverlight Web.Config Setting for Web Service Reference URL?

I have a Silverlight control that is hosted within an ASP.NET application. The Silverlight control has a web service reference. The URL of this service is going to vary when we install the application for our customers. I need a way to be able to change this web service reference URL from within the web.config of the ASP.NET application. How can I do this?
You could do something like http://dev/foo/bar.svc where dev is an entry in your hosts file which will resolve to where the service resides.
If you are using Silverlight 4 you can use urls relative to the page the silverlight app is hosted on. So in ServiceReferences.ClientConfig you can change your endpoint addresses to be relative, say from http://localhost/foo/bar.svc to /foo/bar.svc.

Find Website Name from a web application

I have two web site sites on IIS 7 (Default, Custom). Both Sites host the same web application.
Some of the web application behavior changes depending under what web site it is running. Is there a way for the web application to find out what is the name of the WebSite under which it is handling the current request.
Thank you
Imran
System.Web.Hosting.HostingEnvironment.SiteName
will get you the site name as it appears in IIS
Request.Url.Authority
will get yo the requesting url

How to remove application from IIS7 website

We are migrating some ASP.NET applications from IIS6 to 7. In IIS6, you could create a website and then REMOVE the application. We have several sites with static content to migrate so we would like to do the same in IIS7 but cannot seem to find a way to remove the application.
OTOH is there any overhead to having a website in IIS7 that has an application but nothing ever compiles or 'executes'?
Yes, the non-executable applications are now called Virtual Directories. Map the "applications" as that.

Resources