I have a asp.net web site with it we have admin area with login page for admin only and all site is allowed for all - i need to ask how to define the right security configur
I know these answers are enough, but I'll show the place that's throwing an error.
If you have the structure like the below:
./Src/Master.cs
- (Master Form Page)./Invoice/SubFolder/InvoiceEdit.aspx
- (Sub Form Page)If you enter the sub form page, you'll get an error when you use similar like that you've used in master page: Page.ResolveClientUrl("~/Style/img/logo_small.png")
.
Now ResolveClientUrl
is situated in the master page and trying to serve the root folder. But since you are in the subfolder, the function returns something like ../../Style/img/logo_small.png
. This is the wrong way.
Because when you're up two levels, you are not in the right place; you need to go up only one level, so something like ../
.
You have an image or a favicon link of the style ="../"
somewhere, that if the "../" were valid, would go beyond the top of the site, like this:
Image:
http://example.com/Images/test.jpg
Page
http://example.com/Pages/test.aspx
Valid on that page: ../Images/test.jpg
Would throw an error: ../../Images/test.jpg
It means that one of the paths has a ".." at the beginning of it that would result in exiting the web site's root folder hierarchy. You need to google "asp.net relative paths" or something like that to help you with your problem.
BTW, a hint to where the problem is is included in the exception page that you saw. It will actually tell you what file it found the problem in.
To head off future occurences of this exception, do a search in the entire solution for this string: "../". If you find any of those in files in the root path of your web site, address them.
You can use ~/img/myImage.png
instead of ../img/myImage.png
to avoid this error in ASP.NET pages.