473,626 Members | 3,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Virtual Directory not working

I have a site www.stf.com and a site www.stfstage.com (where I do all my
testing).

The problem is that www.stfstage.com is only internal and I need to get
access from the outside (without creating a new domain).

I tried to create a Virtual directory inside my stf site so that I would
access it like: www.stf.com/stage/.

I run as www.stfstage.com fine and have for a long time.

But if I try to do it as www.stf.com/stage/ I get the error:

*************** *************** ******
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: The module 'ScollKeeperMod ule' is already in the
application and cannot be added again

Source Error:

Line 33: </webServices>
Line 34: <httpModules>
Line 35: <add
type="NFission. WebControls.Scr ollKeeperModule ,NFission.WebCo ntrols.ScrollKe eper"
Line 36: name="ScollKeep erModule" />
Line 37: </httpModules>
Source File: C:\Inetpub\wwwr oot\StfStage\we b.config Line: 35
*************** *************** ******
<configuratio n>
<configSections >
<section name="scrollKee per"
type="NFission. WebControls.Scr ollKeeperConfig Handler,NFissio n.WebControls.S crollKeeper"/>
</configSections>
<scrollKeeper default="true">
<page name="testRIA.a spx" scrollKeep="fal se" />
<page name="JpegImage .aspx" scrollKeep="fal se" />
<page name="JpegImage 2.aspx" scrollKeep="fal se" />
<page name="/employer/registerEmploye r.aspx" scrollKeep="fal se" />
</scrollKeeper>
<system.web>
<compilation defaultLanguage ="vb" debug="true" />
<pages validateRequest ="false" />
<customErrors mode="Off" />
<sessionState
mode="StateServ er"
stateConnection String="tcpip=1 27.0.0.1:42424"
cookieless="fal se"
timeout="400"
/>
<authenticati on mode="Forms">
<forms name="staffing"
loginUrl="/applicant/ee_logon.aspx"
timeout="400"
protection="All "
path="/" />
</authentication>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
<httpModules>
<add
type="NFission. WebControls.Scr ollKeeperModule ,NFission.WebCo ntrols.ScrollKe eper"
name="ScollKeep erModule" />
</httpModules>
<httpHandlers >
<add verb="*" path="MetaBuild ers_DialogWindo w.axd"
type="MetaBuild ers.WebControls .DialogImageHan dler,
MetaBuilders.We bControls.Dialo gWindow" />
<add verb="GET"
path="FtbWebRes ource.axd"
type="FreeTextB oxControls.Asse mblyResourceHan dler, FreeTextBox" />
<add verb="GET" path="CaptchaIm age.aspx"
type="WebContro lCaptcha.Captch aImageHandler, WebControlCaptc ha" />
</httpHandlers>
</system.web>
</configuration>
*************** *************** *************** *************** *************** *********

Scrollkeeper is apparently causing the problem but only as a Virtual
directory. It works fine when I access it as www.stfstage.com.

If I take out the ScrollKeeper sections it seems to have a problem with
virtual paths and gets an error:
*************** *************** *************** *************** *************** ************
The virtual path '/skins/mth/MainPage.ascx' maps to another application,
which is not allowed.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: The virtual path
'/skins/mth/MainPage.ascx' maps to another application, which is not
allowed.

Source Error:

Line 27: navigation = "NavigateTo p" & ".ascx"
Line 28: end if
Line 29: pageControl = LoadControl(the Page)
Line 30: thePlaceHolder. Controls.Add(pa geControl)
Line 31: contentControl =
CType(thePlaceH older.FindContr ol("_ctl0:Navig ation"),Control )

Source File: C:\Inetpub\wwwr oot\StfStage\jo bSeeker\display companyJobs.asp x
Line: 29
*************** *************** *************** *************** *************** ************

My code that is causing the problem is:

tePage = "/skins/" & session("Compan yInitials") & "/" & "MainPage" &
".ascx"
pageControl = LoadControl(the Page)

How can I make this work in my scenario - or can I?

Thanks,

Tom
Aug 23 '07 #1
4 3326
1. web.config files are inheritable.
So in your case when you have www.stf.com/stage/ ASP.NET takes web.config
from www.stf.com folder and merges it with www.stf.com/stage/ folder. That
is why you get an error "The module 'ScollKeeperMod ule' is already in the
application and cannot be added again"

2. When you go by www.stf.com/stage/ your root is considered to be
www.stf.com and /stage/ is subfolder. so when you refer to your controls as
'/skins/mth/MainPage.ascx' you actually refer to
www.stf.com/skins/mth/MainPage.ascx which is another application and you can
not do that. And ASP.NET pollitely tells you about it.

You should use ~/ so it will be '~/skins/mth/MainPage.ascx'. ~ symbol means
in root of application. So in your case the ASP.NET will translate it as
www.stf.com/stage/skins/mth/MainPage.ascx

You can use ~ anywere in a code that processed by ASP.NET
Example:
<img src="~/myimge.gif"-- will not work. The ASP.NET does not parse plain
HTML.
<img src="~/myimge.gif" runat=server--will work correctly. ASP.NET parses
out any tag that marked as runat=server.
George.

"tshad" <t@home.comwrot e in message
news:ex******** ******@TK2MSFTN GP02.phx.gbl...
>I have a site www.stf.com and a site www.stfstage.com (where I do all my
testing).

The problem is that www.stfstage.com is only internal and I need to get
access from the outside (without creating a new domain).

I tried to create a Virtual directory inside my stf site so that I would
access it like: www.stf.com/stage/.

I run as www.stfstage.com fine and have for a long time.

But if I try to do it as www.stf.com/stage/ I get the error:

*************** *************** ******
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: The module 'ScollKeeperMod ule' is already in the
application and cannot be added again

Source Error:

Line 33: </webServices>
Line 34: <httpModules>
Line 35: <add
type="NFission. WebControls.Scr ollKeeperModule ,NFission.WebCo ntrols.ScrollKe eper"
Line 36: name="ScollKeep erModule" />
Line 37: </httpModules>
Source File: C:\Inetpub\wwwr oot\StfStage\we b.config Line: 35
*************** *************** ******
<configuratio n>
<configSections >
<section name="scrollKee per"
type="NFission. WebControls.Scr ollKeeperConfig Handler,NFissio n.WebControls.S crollKeeper"/>
</configSections>
<scrollKeeper default="true">
<page name="testRIA.a spx" scrollKeep="fal se" />
<page name="JpegImage .aspx" scrollKeep="fal se" />
<page name="JpegImage 2.aspx" scrollKeep="fal se" />
<page name="/employer/registerEmploye r.aspx" scrollKeep="fal se" />
</scrollKeeper>
<system.web>
<compilation defaultLanguage ="vb" debug="true" />
<pages validateRequest ="false" />
<customErrors mode="Off" />
<sessionState
mode="StateServ er"
stateConnection String="tcpip=1 27.0.0.1:42424"
cookieless="fal se"
timeout="400"
/>
<authenticati on mode="Forms">
<forms name="staffing"
loginUrl="/applicant/ee_logon.aspx"
timeout="400"
protection="All "
path="/" />
</authentication>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
<httpModules>
<add
type="NFission. WebControls.Scr ollKeeperModule ,NFission.WebCo ntrols.ScrollKe eper"
name="ScollKeep erModule" />
</httpModules>
<httpHandlers >
<add verb="*" path="MetaBuild ers_DialogWindo w.axd"
type="MetaBuild ers.WebControls .DialogImageHan dler,
MetaBuilders.We bControls.Dialo gWindow" />
<add verb="GET"
path="FtbWebRes ource.axd"
type="FreeTextB oxControls.Asse mblyResourceHan dler, FreeTextBox" />
<add verb="GET" path="CaptchaIm age.aspx"
type="WebContro lCaptcha.Captch aImageHandler, WebControlCaptc ha" />
</httpHandlers>
</system.web>
</configuration>
*************** *************** *************** *************** *************** *********

Scrollkeeper is apparently causing the problem but only as a Virtual
directory. It works fine when I access it as www.stfstage.com.

If I take out the ScrollKeeper sections it seems to have a problem with
virtual paths and gets an error:
*************** *************** *************** *************** *************** ************
The virtual path '/skins/mth/MainPage.ascx' maps to another application,
which is not allowed.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: The virtual path
'/skins/mth/MainPage.ascx' maps to another application, which is not
allowed.

Source Error:

Line 27: navigation = "NavigateTo p" & ".ascx"
Line 28: end if
Line 29: pageControl = LoadControl(the Page)
Line 30: thePlaceHolder. Controls.Add(pa geControl)
Line 31: contentControl =
CType(thePlaceH older.FindContr ol("_ctl0:Navig ation"),Control )

Source File: C:\Inetpub\wwwr oot\StfStage\jo bSeeker\display companyJobs.asp x
Line: 29
*************** *************** *************** *************** *************** ************

My code that is causing the problem is:

tePage = "/skins/" & session("Compan yInitials") & "/" & "MainPage" &
".ascx"
pageControl = LoadControl(the Page)

How can I make this work in my scenario - or can I?

Thanks,

Tom

Aug 23 '07 #2
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:O1******** ******@TK2MSFTN GP02.phx.gbl...
1. web.config files are inheritable.
So in your case when you have www.stf.com/stage/ ASP.NET takes web.config
from www.stf.com folder and merges it with www.stf.com/stage/ folder. That
is why you get an error "The module 'ScollKeeperMod ule' is already in the
application and cannot be added again"
Then is there no way to do this?

I need to have ScrollKeeper in my system but I need to call it both ways: as
a website (www.stfstage.com) and as a virtual directory (www.stf.com/stage).

Also, I don't have a problem with any of the other entries in the web.config
files, such as the appSettings:

<appSettings>
<add key="Connection String" value="Persist Security Info=False;Data
Source=xx;Initi al Catalog=yy;User ID=zz;Password= ff;"/>
</appSettings>

In my case, I have a different database for my live application and one for
my development site. In this case, which one would it use? The one from
www.stf.com or the one from the www.stf.com/stage folder?
2. When you go by www.stf.com/stage/ your root is considered to be
www.stf.com and /stage/ is subfolder. so when you refer to your controls
as '/skins/mth/MainPage.ascx' you actually refer to
www.stf.com/skins/mth/MainPage.ascx which is another application and you
can not do that. And ASP.NET pollitely tells you about it.

You should use ~/ so it will be '~/skins/mth/MainPage.ascx'. ~ symbol
means in root of application. So in your case the ASP.NET will translate
it as www.stf.com/stage/skins/mth/MainPage.ascx

You can use ~ anywere in a code that processed by ASP.NET
Example:
<img src="~/myimge.gif"-- will not work. The ASP.NET does not parse
plain HTML.
<img src="~/myimge.gif" runat=server--will work correctly. ASP.NET
parses out any tag that marked as runat=server.
That seems to work as you say.

I did do a trace on this page and here is what it is showing:

PATH_INFO /stage/JobSeeker/displayCompanyJ obs.aspx
PATH_TRANSLATED
C:\Inetpub\wwwr oot\StfStage\Jo bSeeker\display CompanyJobs.asp x

So the system knows what the path is so I am not sure why I need the "~" but
it does work. As you say if I do:

<img src="~/myimge.gif">

It doesn't work and shows as a broken gif. But

<img src="/myimge.gif">

does seem to work and knows to look at the root of the Application. I would
have thought that .net objects would do the same (would have been more
consistent). I would have thought that you would use the "~" for the
exceptions. Oh well.

The other thing that doesn't seem to work is:

<img src="../../myimge.gif">

Which works fine if I call it from www.stfstage.com but why wouldn't it work
here? It has nothing to do with the root of the Application.

Thanks,

Tom
>

George.

"tshad" <t@home.comwrot e in message
news:ex******** ******@TK2MSFTN GP02.phx.gbl...
>>I have a site www.stf.com and a site www.stfstage.com (where I do all my
testing).

The problem is that www.stfstage.com is only internal and I need to get
access from the outside (without creating a new domain).

I tried to create a Virtual directory inside my stf site so that I would
access it like: www.stf.com/stage/.

I run as www.stfstage.com fine and have for a long time.

But if I try to do it as www.stf.com/stage/ I get the error:

************** *************** *******
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: The module 'ScollKeeperMod ule' is already in the
application and cannot be added again

Source Error:

Line 33: </webServices>
Line 34: <httpModules>
Line 35: <add
type="NFission .WebControls.Sc rollKeeperModul e,NFission.WebC ontrols.ScrollK eeper"
Line 36: name="ScollKeep erModule" />
Line 37: </httpModules>
Source File: C:\Inetpub\wwwr oot\StfStage\we b.config Line: 35
************** *************** *******
<configuration >
<configSection s>
<section name="scrollKee per"
type="NFission .WebControls.Sc rollKeeperConfi gHandler,NFissi on.WebControls. ScrollKeeper"/>
</configSections>
<scrollKeepe r default="true">
<page name="testRIA.a spx" scrollKeep="fal se" />
<page name="JpegImage .aspx" scrollKeep="fal se" />
<page name="JpegImage 2.aspx" scrollKeep="fal se" />
<page name="/employer/registerEmploye r.aspx" scrollKeep="fal se" />
</scrollKeeper>
<system.web>
<compilation defaultLanguage ="vb" debug="true" />
<pages validateRequest ="false" />
<customErrors mode="Off" />
<sessionState
mode="StateServ er"
stateConnection String="tcpip=1 27.0.0.1:42424"
cookieless="fal se"
timeout="400"
/>
<authenticati on mode="Forms">
<forms name="staffing"
loginUrl="/applicant/ee_logon.aspx"
timeout="400"
protection="All "
path="/" />
</authentication>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
<httpModules>
<add
type="NFission .WebControls.Sc rollKeeperModul e,NFission.WebC ontrols.ScrollK eeper"
name="ScollKeep erModule" />
</httpModules>
<httpHandlers >
<add verb="*" path="MetaBuild ers_DialogWindo w.axd"
type="MetaBuild ers.WebControls .DialogImageHan dler,
MetaBuilders.We bControls.Dialo gWindow" />
<add verb="GET"
path="FtbWebRes ource.axd"
type="FreeTextB oxControls.Asse mblyResourceHan dler, FreeTextBox" />
<add verb="GET" path="CaptchaIm age.aspx"
type="WebContr olCaptcha.Captc haImageHandler, WebControlCaptc ha" />
</httpHandlers>
</system.web>
</configuration>
************** *************** *************** *************** *************** **********

Scrollkeeper is apparently causing the problem but only as a Virtual
directory. It works fine when I access it as www.stfstage.com.

If I take out the ScrollKeeper sections it seems to have a problem with
virtual paths and gets an error:
************** *************** *************** *************** *************** *************
The virtual path '/skins/mth/MainPage.ascx' maps to another application,
which is not allowed.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: The virtual path
'/skins/mth/MainPage.ascx' maps to another application, which is not
allowed.

Source Error:

Line 27: navigation = "NavigateTo p" & ".ascx"
Line 28: end if
Line 29: pageControl = LoadControl(the Page)
Line 30: thePlaceHolder. Controls.Add(pa geControl)
Line 31: contentControl =
CType(thePlace Holder.FindCont rol("_ctl0:Navi gation"),Contro l)

Source File:
C:\Inetpub\www root\StfStage\j obSeeker\displa ycompanyJobs.as px Line: 29
************** *************** *************** *************** *************** *************

My code that is causing the problem is:

tePage = "/skins/" & session("Compan yInitials") & "/" & "MainPage" &
".ascx"
pageControl = LoadControl(the Page)

How can I make this work in my scenario - or can I?

Thanks,

Tom


Aug 23 '07 #3
1. I am not sure about configuration section. May be that part is not
inheritable. But you can have ScrollKeeperMod ule in both web.config
sections.
You can remove it first and then add. Look in MSDN (do not know exact
syntax)
something like
<httpModules>
<remove name="ScollKeep erModule">
<add
type="NFission. WebControls.Scr ollKeeperModule ,NFission.WebCo ntrols.ScrollKe eper"
name="ScollKeep erModule" />
</httpModules>

2. "/myimage.gif" works simply because you have same folders/files in
www.stf.com as in www.stf.com/stage

the page in www.stf.com/stage that references a /myimage.gif is actually
referencing www.stf.com/myimage.gif and not www.stf.com/stage/myimage.gif

When you prefix path with / (like myimage.gif) it's called absolute path.
Browser automaticly adds server name to get full URL.
When you do not have / (like ../../myimage.gif) then it's called relative
path and browser automaticly appends the path of the current page to it. It
has nothing to do with ASP.NET. It's how browser works. If you using ~ in
ASP.NET then ASP.NET engine converts ~ to absolute path and appends current
application folder. So if you look at the HTML source you will not see ~ you
will see /stage/

Example: if you page's url is http://www.stf.com/stage/folder1/mypage.aspx
and that page had an <img src="../../myimge.gif">
then you actually refer to
http://www.stf.com/stage/folder1/../..myimage.gif" wich in turn is
http://www.stf.com/myimage.gif
if that page had an <img src="/myimage.gif" then it refers to
http://www.stf.com/myimage.gif
if that page had an <img src="myimage.gi f" then it refers to
http://www.stf.com/stage/folder1/myimage.gif
George.



"tshad" <t@home.comwrot e in message
news:uB******** ******@TK2MSFTN GP05.phx.gbl...
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:O1******** ******@TK2MSFTN GP02.phx.gbl...
>1. web.config files are inheritable.
So in your case when you have www.stf.com/stage/ ASP.NET takes web.config
from www.stf.com folder and merges it with www.stf.com/stage/ folder.
That is why you get an error "The module 'ScollKeeperMod ule' is already
in the application and cannot be added again"
Then is there no way to do this?

I need to have ScrollKeeper in my system but I need to call it both ways:
as a website (www.stfstage.com) and as a virtual directory
(www.stf.com/stage).

Also, I don't have a problem with any of the other entries in the
web.config files, such as the appSettings:

<appSettings>
<add key="Connection String" value="Persist Security Info=False;Data
Source=xx;Initi al Catalog=yy;User ID=zz;Password= ff;"/>
</appSettings>

In my case, I have a different database for my live application and one
for my development site. In this case, which one would it use? The one
from www.stf.com or the one from the www.stf.com/stage folder?
>2. When you go by www.stf.com/stage/ your root is considered to be
www.stf.com and /stage/ is subfolder. so when you refer to your controls
as '/skins/mth/MainPage.ascx' you actually refer to
www.stf.com/skins/mth/MainPage.ascx which is another application and you
can not do that. And ASP.NET pollitely tells you about it.

You should use ~/ so it will be '~/skins/mth/MainPage.ascx'. ~ symbol
means in root of application. So in your case the ASP.NET will translate
it as www.stf.com/stage/skins/mth/MainPage.ascx

You can use ~ anywere in a code that processed by ASP.NET
Example:
<img src="~/myimge.gif"-- will not work. The ASP.NET does not parse
plain HTML.
<img src="~/myimge.gif" runat=server--will work correctly. ASP.NET
parses out any tag that marked as runat=server.

That seems to work as you say.

I did do a trace on this page and here is what it is showing:

PATH_INFO /stage/JobSeeker/displayCompanyJ obs.aspx
PATH_TRANSLATED
C:\Inetpub\wwwr oot\StfStage\Jo bSeeker\display CompanyJobs.asp x

So the system knows what the path is so I am not sure why I need the "~"
but it does work. As you say if I do:

<img src="~/myimge.gif">

It doesn't work and shows as a broken gif. But

<img src="/myimge.gif">

does seem to work and knows to look at the root of the Application. I
would have thought that .net objects would do the same (would have been
more consistent). I would have thought that you would use the "~" for the
exceptions. Oh well.

The other thing that doesn't seem to work is:

<img src="../../myimge.gif">

Which works fine if I call it from www.stfstage.com but why wouldn't it
work here? It has nothing to do with the root of the Application.

Thanks,

Tom
>>

George.


Aug 23 '07 #4
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
1. I am not sure about configuration section. May be that part is not
inheritable. But you can have ScrollKeeperMod ule in both web.config
sections.
You can remove it first and then add. Look in MSDN (do not know exact
syntax)
something like
<httpModules>
<remove name="ScollKeep erModule">
<add
type="NFission. WebControls.Scr ollKeeperModule ,NFission.WebCo ntrols.ScrollKe eper"
name="ScollKeep erModule" />
</httpModules>
I tried that, but it won't work.

If I add the remove statement to the the Web.Config section of the
www.stfstage.com site, the error about it already being there is gone. But
if I run it as:

www.stf.com/stage

I get the error:

Parser Error Message: Exception in configuration section handler.

Source Error:

Line 3: <section name="scrollKee per"
type="NFission. WebControls.Scr ollKeeperConfig Handler,NFissio n.WebControls.S crollKeeper"/>
Line 4: </configSections>
Line 5: <scrollKeeper default="true">
<--- This is the error
Line 6: <page name="testRIA.a spx" scrollKeep="fal se" />
Line 7: <page name="JpegImage .aspx" scrollKeep="fal se" />

If I do it from www.stfstage.com, I get the error:

Parser Error Message: There is no 'ScollKeeperMod ule' module in the
application to remove.

Source Error:

Line 33: </webServices>
Line 34: <httpModules>
Line 35: <remove name="ScollKeep erModule"/>
Line 36: <add
type="NFission. WebControls.Scr ollKeeperModule ,NFission.WebCo ntrols.ScrollKe eper"
Line 37: name="ScollKeep erModule" />

I kind of expected this error, since it would not have been added in the stf
website.

Thanks,

Tom
>
2. "/myimage.gif" works simply because you have same folders/files in
www.stf.com as in www.stf.com/stage

the page in www.stf.com/stage that references a /myimage.gif is actually
referencing www.stf.com/myimage.gif and not www.stf.com/stage/myimage.gif

When you prefix path with / (like myimage.gif) it's called absolute path.
Browser automaticly adds server name to get full URL.
When you do not have / (like ../../myimage.gif) then it's called relative
path and browser automaticly appends the path of the current page to it.
It has nothing to do with ASP.NET. It's how browser works. If you using ~
in ASP.NET then ASP.NET engine converts ~ to absolute path and appends
current application folder. So if you look at the HTML source you will not
see ~ you will see /stage/

Example: if you page's url is http://www.stf.com/stage/folder1/mypage.aspx
and that page had an <img src="../../myimge.gif">
then you actually refer to
http://www.stf.com/stage/folder1/../..myimage.gif" wich in turn is
http://www.stf.com/myimage.gif
if that page had an <img src="/myimage.gif" then it refers to
http://www.stf.com/myimage.gif
if that page had an <img src="myimage.gi f" then it refers to
http://www.stf.com/stage/folder1/myimage.gif
George.



"tshad" <t@home.comwrot e in message
news:uB******** ******@TK2MSFTN GP05.phx.gbl...
>"George Ter-Saakov" <gt****@cardone .comwrote in message
news:O1******* *******@TK2MSFT NGP02.phx.gbl.. .
>>1. web.config files are inheritable.
So in your case when you have www.stf.com/stage/ ASP.NET takes
web.config from www.stf.com folder and merges it with www.stf.com/stage/
folder. That is why you get an error "The module 'ScollKeeperMod ule' is
already in the application and cannot be added again"
Then is there no way to do this?

I need to have ScrollKeeper in my system but I need to call it both ways:
as a website (www.stfstage.com) and as a virtual directory
(www.stf.com/stage).

Also, I don't have a problem with any of the other entries in the
web.config files, such as the appSettings:

<appSettings>
<add key="Connection String" value="Persist Security Info=False;Data
Source=xx;Init ial Catalog=yy;User ID=zz;Password= ff;"/>
</appSettings>

In my case, I have a different database for my live application and one
for my development site. In this case, which one would it use? The one
from www.stf.com or the one from the www.stf.com/stage folder?
>>2. When you go by www.stf.com/stage/ your root is considered to be
www.stf.com and /stage/ is subfolder. so when you refer to your controls
as '/skins/mth/MainPage.ascx' you actually refer to
www.stf.com/skins/mth/MainPage.ascx which is another application and you
can not do that. And ASP.NET pollitely tells you about it.

You should use ~/ so it will be '~/skins/mth/MainPage.ascx'. ~ symbol
means in root of application. So in your case the ASP.NET will translate
it as www.stf.com/stage/skins/mth/MainPage.ascx

You can use ~ anywere in a code that processed by ASP.NET
Example:
<img src="~/myimge.gif"-- will not work. The ASP.NET does not parse
plain HTML.
<img src="~/myimge.gif" runat=server--will work correctly. ASP.NET
parses out any tag that marked as runat=server.

That seems to work as you say.

I did do a trace on this page and here is what it is showing:

PATH_INFO /stage/JobSeeker/displayCompanyJ obs.aspx
PATH_TRANSLATE D
C:\Inetpub\www root\StfStage\J obSeeker\displa yCompanyJobs.as px

So the system knows what the path is so I am not sure why I need the "~"
but it does work. As you say if I do:

<img src="~/myimge.gif">

It doesn't work and shows as a broken gif. But

<img src="/myimge.gif">

does seem to work and knows to look at the root of the Application. I
would have thought that .net objects would do the same (would have been
more consistent). I would have thought that you would use the "~" for
the exceptions. Oh well.

The other thing that doesn't seem to work is:

<img src="../../myimge.gif">

Which works fine if I call it from www.stfstage.com but why wouldn't it
work here? It has nothing to do with the root of the Application.

Thanks,

Tom
>>>

George.



Aug 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1308
by: Daniel | last post by:
hi newsgroup, i would like to use cvs for a web application project. i don't need a cvs server because i am working on my own. i have tried this with tortoisecvs, but i was not able to use a virtual directory for my sandbox or as repository. any idea? thanks in advance,
2
2779
by: Danny Miller | last post by:
Hi there, I'm facing a problem that is driving me nuts. The scenario is as follows: 1) Create an empty directory structure e.g. C:\Dev1\TestWebApp 2) Map a virtual directory e.g. TestWebApp to this new directory 3) Under C:\Dev1 create a blank visual studio solution and add a new web project called TestWebApp (which will be created in C:\Dev1\TestWebApp and
2
1073
by: Jozef | last post by:
Hi Folks, I have the MSPetShop demo set up to look at the architecture of a multi tier system. When I put the files in the virtual directory I created for this demo, the program doesn't work. When I put the files in the wwwroot directory it does. Any idea why or how to get the ASP.net pages to load in the virtual directory? Thanks!
2
2605
by: BLetts | last post by:
I have an ASP.NET app that must allow users to upload files. The files are stored in a virtual directory. I use Server.MapPath to map from the virtual directory name to a physical path, then the FileUpload control SaveAs method to upload and save the file. This all works fine when the virtual directory points to a local drive on the ASP.NET server. However, when pointing to a remote drive (which is what my client wants to do), I get...
2
4632
by: WisTex | last post by:
I've come across a very weird problem. Virtual includes work on all my ASP pages on the entire website, including those in subdirectories, yet they won't work on a particular page I created, even though the virtual include statement is copy & pasted exactly as it appears on the working pages. What would cause virtual includes to work in one page on a website, but not on another? Error Message: Microsoft VBScript runtime error...
4
1854
by: Just D. | last post by:
How can we change the property of one subdirectory of the Virtual Directory? One of the directories should be granted "Write". Should we delete this Virtual Directory to recreate it with the required property or there is some way to do that? What I see now is a poor documentation on the Internet about that. Thanks, Just D.
9
2586
by: antonyliu2002 | last post by:
I have a C# class GeneralUtilities.cs , which many of my aspx.cs files will refer to. So, I've put it under the App_Code folder and compiled it to library using csc /target: library from the DOS console. I can use objects of type GeneralUtilities in any aspx.cs file in my web application without any problem if only I make my web application folder a virtual directory. If I don't make it a virtual directory, the compiler complains...
2
1465
by: tshad | last post by:
I have set up a Virtual Directory underneath my normal Web Site in IIS 6 for 2 of our sites. One of them works file. The other one is giving me an error: **************************************************************************** Parser Error Message: The module 'ScollKeeperModule' is already in the application and cannot be added again
12
2331
by: Pao | last post by:
Hi all For all NEW sites (virtual directories) that I create, I receive always the same error: (I translate so may be a little different) Impossible to visualize the XML page Impossible to visualize the XML input through the XSL sheet. Correct the error, then click on Update, or try another time.
5
7323
by: OK | last post by:
I am using an image control to display some images within a virtual map (ImagesRoot in IIS) outside of the web root in my vb asp.net application. How should I code the imageurl property to have this working? Image1.imageurl = ?
0
8266
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8199
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8365
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7196
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.