473,388 Members | 1,215 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Duplicate folder name in URL

Hello,
We have a problem in our web application.
The error reported is given with in brackets []:
[
Server Error in '/AccountClient' Application.
The resource cannot be found
Description: HTTP 404. The resource you are looking for(or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable.
Please review the following URL and make sure that it is spelled correctly.
Requested URL:
/accountClient/Home/Controller/Home/Controller/Home.aspx
]
You can see the folder name "/Home/Controller/ getting repeated in the URL.
For you information the framework used is .Net framework 1.1, the web
server is
IIS 5 and OS is Win2000 server. We used .Net Remoting in our web
application.This problem is reported once in a while and not consistently
happening.

Home.aspx is the first page getting loaded after a successful authentication
in our application (after login.aspx) All the common urls used across the
applicaiton are configured in the web.config file.

We have a section called <redirectsin the web.config and under which we
have various key names. In each of these key names a URL is assigned.
For example
<add key="LoginSuccess" value="../../Home/Controller/Home.aspx" />

In login.aspx page, once if the user's authentication is validated, using a
config reader the LoginSuccess key value is fetched and the user is routed to
the home.aspx page.

This works fine in most of the case(95%). Rarely the users are getting the
error reported in the beginining.

Once if this issue is reported our IT operation persons will open the
web.config file and do a re-save. Once if they restart the application, the
application works fine for the same user who got the error before(i.e., the
home.aspx loads properly).
Can some one explain us how exactly IIS treats web.config?.

Is IIS storing the web.config in it when the application first started?. And
is it getting locked or something. Because when we resave the web.config,
this whole problem is not happening.

Thanks in advance,
Aloysius

Jul 13 '06 #1
4 2422
Hi Aloysius,

Welcome to the ASP.NET newsgroup.

From your description, I understand you're developing an ASP.NET web
application which is using forms authentication. And after the client users
are authenticated(be valid), the login page will read a appsetting key
(named "LoginSuccess" ) from the web.config file and redirect the user to
that url (stored in the value of that appsetting key). This redirection
works mostly , however you found that it will fails in rare cases which
result to a 404 file not found error, correct? If there is anything I
missed, please feel free to let me know.

Based on my experience, this is likely a path resolving issue which could
be due to the path you used for the "LoginSuccess" URL and the approach you
used to perform the redirection. Would you provide the code you used to
perform the redirection so that I can have a look at it?

I think the web.config should not be the cause because the .net runtime
just simply read the web.config and pickup the key/value from its
"appsettings" section. We can verify this by adding code to always write
the value into eventlog or a log file each time the login page reading
that"LoginSuccess" key from web.config.

As I mentioned before that this is likely a path resolution issue, because
your "LoginSuccess" key's url value is "../../Home/Controller/Home.aspx"
which is a relative path. And such path will be resolved to different value
according to the current web request's context( the original page(which is
request)'s folder location in this web application). It is recommend that
you try using an absolute path in such scenario. For example, you can use
an absolute path which based on the IIS site root, e.g:

"/WebAppName/subdir/pagename.aspx"

"/...." means this path is an absolute path which start from IIS site root.
Such path will not be resolved as different value due to different request
context. You can use this path only for test since it is somewhat hardcoded
and not flexible enough.
Another means to produce an absolute path is using code to generate a path,
the Page class has a "ResolveUrl" method this can help resolve a ASP.NET
awared server-side path to its correct (client browser awared path). For
example:

"~/subdir/pagename.aspx"

the above path usually means an absolute path which start from ASP.NET web
application's root directory. Normally this path is only used by ASP.NET
Server Control, such as

<asp:Image ImageUrl="~/Images/image.gif" .... />

However, we can use code to programmatically resolve such server-side path.
e.g:

string cilentPath = Page.ResolveUrl("~/Images/image.gif")

Therefore, you can also consider using this means to resolve the absolute
url in your login page's redirection code. And the value stored in
web.config could be "~/ ...." style path.

In addition, you can ask your server admin to check the IIS log (especially
the log entires associated with those problem requests). We can find the
complete requests' path redirection process in the log entries and these
are usually helpful.
Hope this helps some. If there is anything unclear, please feel free to
post here.
Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 13 '06 #2
Hi Aloysius,

How are you doing on this issue, have you got any progress on this or does
my last reply helps some on this?

If there is any thing unclear in my last message or anything else we can
help, please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 17 '06 #3
Hi Steven,
Sorry for my late reply. Actually we were trying out few options in our
environment and it consumed bit more time.
Your reply really helped me a lot it approaching the problem in a systamatic
way.
As I mentioned earlier, the problem is happening only in production and not
replicable in local testing/development environment. So we decided to track
the URL string passed in all the redirection methods used in our application
(like response.redirect, server.transfer, HyperLink.NavigateURL etc). This
can help us in deciding whether the problem is at application level or at
environment level( can be IIS).
As per your inputs, we decided to introduce site root relative path(using ~/
instead of ../../) only for Home.aspx redirections. As this problem is
frequently reported in this page redirection, we took this page for our
analysis. If the problem is not reported over a period of time we will
implement the site root relative path instead of relative path for all our
redirections.

I hope this problem will get over soon.
Again thanks for your inputs and suggestions. I will update you soon when I
get a reply from our customers.

Thanks and Regards,
Aloysius
--
Aloysius
"Steven Cheng[MSFT]" wrote:
Hi Aloysius,

How are you doing on this issue, have you got any progress on this or does
my last reply helps some on this?

If there is any thing unclear in my last message or anything else we can
help, please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '06 #4
Thanks for your followup Aloysius,

I'm glad that the information is of assistance. As we're closely monitoring
the thread, please feel free to post here if you need any further help.

Good luck & Have a good day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 21 '06 #5

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

Similar topics

1
by: Santi Serrano | last post by:
Hi, Ok, I open Visual Studio .NET 2003. New C# ASP.NET Web Service project. Everything works fine. When I'm done I close Visual Studio, go to the web server home directory and make a copy of the...
2
by: news | last post by:
I just upgraded to PHP 4.4.2 on my Slackware 10.2 system. And Apache/mySQL/PHP all work great through a browser. No errors. But when I try to run a PHP script through the command line, which I...
5
by: Manish | last post by:
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone |...
0
by: Johan P | last post by:
Having just compiled DBG 2.15.1 and trying to use it with PHP (cli) give some some problem. Verions: DBG 2.15.1 PHP 4.4.4 (cli) It works fine compiled with the Apache module but when I try...
5
by: rob | last post by:
Does anyone know of a duplicate file checker project in C#? Couldn't locate anything on CodeProject or SourceForge. Has anyone here considered writing one?
1
by: KoRnDragon | last post by:
I need a Javascript function that will display X random images on a page that also doesn't display the same image twice. Bonus points if it grabs the max array from the folder and sets it. Even...
0
by: Narendra Gc | last post by:
Hi... I am looking after a lan . I am i am not able to access one particular system , by another one particular system. But from these computers i can access all other systems in my lan and...
1
by: David C | last post by:
I need to loop through an entire directory of folders and look for any that have the same 1st 4 characters. I know how to loop and read just the 1st 4 characters but I need some help determining...
2
by: A n g l e r | last post by:
Hi all. I'm having a truly bugging me problem going on here. When I get to Tools->Options->VC++ Directories and try to set up paths for x64, it turns out that it's listed in a drop-box twice!...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.