Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 April 11th, 2008, 09:24 PM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default Strange Behaviour

Hi Imar,

I finished chapter 10.

I mentioned earlier that I had some concerns that I wanted to bring up (I wanted to try to find the answers myself first).

Before I go to far, I thought I'd bring one up now and others up later. I will not exhaust this topic and hope you don't mind if I use this topic for this purpose.

1) I get very odd behaviour when I use the html img element.

I've always used the following with no problem, until I tried using it in VWD and the .net framework. It works in IE but the image doesn't show in firefox. Even stranger, if I put the element twice in a row, one works and the other doesn't.

<img src="Images/DSCF3458.jpg" alt="" />

In order for it to work in firefox, I need to switch the scr and alt positioning:

<img alt="" src="Images/DSCF3458.jpg" />

Is there something wrong??? Is this a .net rule I have to be concerned about?

(Future question will be why I cannot get my css rules to work with columns, but I will continue to try and resolve it on my own for awhile.)

Appreciated Imar,

Terry



 
Old April 11th, 2008, 10:20 PM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, ignore that one. LOL

I found out the problem. Once again, it's firefox. For some reason, it doesn't always clear the cache. It works fine when I clear it and close VWD. Other times it works when I just clear the cache (although the cache is set to clear when I close the browser). I don't fully understand it, especially because I don't have problems like this using Dreamweaver. It will take some time to get use to the cache problems.

 
Old April 12th, 2008, 02:35 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This can happen quite easily during development. Always try to force a page refresh using Ctrl+R or Ctrl+F5 to get the latest version from the server.

That usually does the trick....

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old April 12th, 2008, 02:01 PM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh... OK, sometimes it takes two or three times refreshing the browser before it works.

Thanks for that... (no more hair pulling)

Terry

 
Old April 13th, 2008, 07:49 PM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

There are two things that I wanted to try to resolve before I went on in the book but failed to find the answers for. One I will bring up now, and I will try to resolve the other while I move on into the book.

This one is about adding background images in the css file. I've always been taught to insert it with quotes and always used them in the css:

background-image: url("Images/PleaseWait.gif");

Whereas you are teaching to add it without the quotes:

background-image: url(Images/PleaseWait.gif);

Can you explain why quotes are not used in the css file for background images? Is this a .net thing?

Additionally, when I add a background using browse, it adds the image like this:

background-image: url( '/C:/Visual Studio 2008/BegASPNET/Site/Images/PleaseWait.gif' );

Is there a way to have it to add it in the css properly without always typing it?

Thanks Imar,
Terry



 
Old April 13th, 2008, 08:01 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I think it's a fair blanket statement to say that any CSS or HTML presented in the context of an ASP.NET page is not directly influenced by .NET (apart from the HTML /CSS that is actually generated by the framework). That is to say, in this example, the particular syntax offered for a style sheet in a .NET web site is not influenced by the fact that it is in a .NET web site. It's just a standard style sheet. There are no .NET influenced feature in the current web standards (nor need/should there be).

Regarding the actual syntax in question:
"The format of a URI value is 'url(' followed by optional whitespace followed by an optional single quote (') or double quote (") character followed by the URI itself, followed by an optional single quote (') or double quote (") character followed by optional whitespace followed by ')'. The two quote characters must be the same."
Source: http://www.w3.org/TR/1998/REC-CSS2-1...ndata.html#uri

-Peter
peterlanoie.blog
 
Old April 14th, 2008, 12:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

As Peter pointed out, the quotes are optional, and indeed don't have anything to do with .NET. Remember, the CSS file is just included in the final HTML, downloaded by the browser and applied there. As far as .NET is concerned, it's hardly aware of the existence of the style sheet.

Since the quotes are optional, you can leave them out ;) I think I ran into some issues a long time ago with quotes in Firefox, and left them out ever since. The problem in Firefox may have been fixed by now, but still the quoteless way has become my standard. Feel free to change it, as both styles will work.

I never use the Browse option for the background-image and always manually type it (don't need to do it a 100 times a day, so it doesn't bother me much). However, if you find this frustrating, you could report it with Microsoft and hopefully they'll fix it for a future release.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old April 14th, 2008, 04:42 AM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok — short version — it makes no difference.

It all makes since.

I really appreciate all your help Imar. A for adding a background image, I often forget the file name. But I could copy paste after browsing. I'm just spoiled by using Dreamweaver.

Thank you also Peter, especially for that link.

Terry

 
Old April 14th, 2008, 06:11 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

As an alternative, you can also drag the file from the Solution Explorer and drop it between the parentheses of url(). Then all you need to do is remove the first part of the path.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old April 14th, 2008, 11:16 AM
Authorized User
 
Join Date: Jan 2007
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That works for me. Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange behaviour with IE smolds BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 October 15th, 2005 08:49 PM
Strange TextBox Behaviour Jim Rogers Pro VB.NET 2002/2003 0 September 12th, 2005 07:13 PM





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