Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I want to create two virtual directories (lets call them as VD1 and VD2) poiniting to the same physical directory.
The only difference between the two virtual directories should be in terms of 'Impersonation'.
i.e. VD1 has impersonation = 'true' and VD2 has impersonation = 'false'
Is it possible to do configure this in IIS?
I tried the Impersonate option, but it also changes the web.config and I want to keep the same web.config for both the virtual directories.
Any help is appreciated.
Posted

1 solution

Impersonation is a subject of Asp.net. So, I don't think you can do this in IIS.

What you need is the following:

1. Implement a method that does impersonation programmatically, and do not impersonate in web.config.

2. Check the virtual directory name using the Request.ApplicationPath property and call this method if only it matches with your target virtual directory (You might be able to do this in the Application_BeginRequest event in Global.asax or in some base class method).

I believe, you can Google and get some codes to do programmatic impersoation. This Link[^] might help you.
 
Share this answer
 
v2
Comments
senguptaamlan 17-Sep-10 2:49am    
perfect

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900