background error

J

jcharles

Hi,

I'm learning some cool things in the asp.net 2. And when I was using
the master page, I created one in the root folder. And created a
derived web form in other folder. But when I open this derived webform,
the background table image doesn't appear.

Structure

|
-MasterPage.Master
-style.css
|
______Images\Bg.jpg
|
______Pages\DerivedPage.aspx

And the background is coded by: <td style="background-image:
url(/images/bg.jpg);"> in the .master page.
If I create a page in root folder the background appears, but when I
moved the derived page to other folder, the background doesn't appear.

Can any body help me? Thanks.
 
R

Ray Costanzo [MVP]

That html snippet, did you copy and paste that from your actual master page,
or did you rewrite it? The leading slash is vital, and have it in the
nippet below. But is that really in the master page?

Ray at work
 
J

jcharles

Hm..i got ok now...i just put the relative path symbol before the css
link ("~/") in the master page and moved the background style to the
css file...
But now im got other problem....im doing the forms authentication with
the membership provider of the asp.net 2....and put this code in the
web.config:


<authentication mode="Forms">
<forms loginUrl="~/secure/Login.aspx"
protection="All"
timeout="45"
name="MyAppTest"
path="/FormsAuth"
requireSSL="false"
slidingExpiration="true"
defaultUrl="~/default.aspx"
cookieless="UseCookies"
enableCrossAppRedirects="false" />
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>


And now, when i open the website,it automatically redirect me to the
login.aspx page,that based too in the same master page. But it doesnt
show any image. Its like it deny access to the images and css
directories. What do i need to put in the web.config to correct this?
The login.aspx page is in the "/secure" directory and the images and
css files in the "/others" directory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top