Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2006, 03:43 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Do you block access to all files in your site with a setting in the web.config? If so, you may accidentally be blocking the image that you want to display as well. By default, the built in web server blocks access to all files, including images, while IIS only blocks files that are registered with ASP.NET.

To fix that, add a <location> tag to the web.config that points to your image or images folder. Then set an allow on that folder for all users.

Take a look here for more details:

http://weblogs.asp.net/scottgu/archi...31/437027.aspx

To learn more about CSS, take a look at this book: http://www.wrox.com/WileyCDA/WroxTit...764576429.html

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old June 1st, 2006, 10:02 PM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you got the same problem that I used to have. In XP: Right-click icon of internet explorer ->properties ->general tab ->button settings. Choose the first radio button.

Now it should update the background in the page in runtime...

 
Old July 5th, 2006, 01:19 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Imar,
I hope you see it and answer.
I had the same problem with backround images in the master page. I followed your instruction and created a styleshhet and worked fine. I acctually created something like this
.Test
{
  background-image: url(../Images/background_main.jpg);
  background-position: center;
  height: 116px;
}

and used it like this
<td colspan="6" class="Test">

It worked fine. The backround image in the master page appeared both at the pages included in the same directory and also to those that existed in subdirectories.
First of all. Why is the dot before the style name?

Then I tried to change the name instead of test both at the stylesheet and at the master page but the image didn't appear at all. I change it back to test and worked ok.
Since I have 3 backround images like these in my master page I tried to create 2 other styles in the stylesheet and put them in the master page. The images where gone. Only if I used the initially created test style the image used in it appeared in the in the table cell. This is really crazy.
It seems that there is a cashe that stores only the initially created test style somewhere. The really stupid thing is that when I change something inside the test style these changes appear at the master page. 4 hours looking at forums with no solution. I hope you can create more than one tablecell style in the master page. I'm not sure about anything now.

Can you please help me?

Regards,
Manolis Perrakis


 
Old July 5th, 2006, 01:57 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

don't matter.
After I restarted the computer everything worked as expected. Only on question. Why is the dot in the style name?
Regards,
Manolis

 
Old July 5th, 2006, 04:22 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The . is just CSS syntax.

.Test refers to a class called test (e.g. <td class="Test">)

#Test refers to an element with an ID of test (e.g. <td id="Test">)

Without a . or a #, an element is referenced (e.g. h2)

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old July 27th, 2007, 10:53 AM
Registered User
 
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have a similar problem. I was using Windows authentication to access the website. I have an image on my page that is displayed at the top of each page. As soon as I change to Forms authentication and named the "default.aspx" as my loginurl, I lost the image. So, I created a Master Page because a co-worker said he uses master pages and never has this problem. I've tried everything you've put on this page and still can't get the image to show. Here's my code:
<link href="srfstyle.css" rel="stylesheet" type="text/css" />

<img runat="server" height="200" src="images/srflogo2007.jpg" width="200" border="0" />

Thanks for your help.
 
Old July 28th, 2007, 04:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi rfrancis,

Did you add a <location> element to the web.config file to unblock the Images folder? If so, how does it look like?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old July 31st, 2007, 11:48 AM
Registered User
 
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes. Here's what I have:

    <location path="srfstyle.css">
            <system.web>
                <authorization>
                    <allow users="*"/>
                </authorization>
            </system.web>
    </location>

This did not work, either. This style sheet was only blocked when I changed to "forms" authentication mode.
 
Old July 31st, 2007, 11:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

And how does the final HTML in the browser look like?

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 1st, 2007, 01:46 PM
Registered User
 
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the web browser I cannot see the picture at all. It shows up as an empty box with an x in upper left hand corner. The text format did not use the style sheet, instead it was just plain text, I believe just the default. I'm pretty much at a loss. I've used forms authentication before and it's never done this. I hope you can help.

Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
TreeView in MasterPage - ExpandDepth problem Colonel Angus Visual Studio 2005 1 December 28th, 2007 12:45 PM
Problem with images....... kethireddy435 ASP.NET 1.x and 2.0 Application Design 1 September 14th, 2007 11:20 AM
problem with images mattalec101 Xcode 1 June 7th, 2007 12:28 PM
Problem with Javascript on MasterPage rajeshmoorthy ASP.NET 2.0 Basics 0 May 17th, 2007 04:38 AM
Problem in Javascript -Masterpage ratheesh_param ASP.NET 2.0 Professional 0 December 4th, 2006 06:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.