Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 19th, 2010, 02:39 AM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default Invisible Post-processing

I've used literal controls from time to time, especially when I need to generate some custom HTML and don't want the <span> tags around it which a label would generate. But I've never run into unexpected behavior before, literal has always simply output the string I feed it.

I'm outputting a string to a literal control. The string contains several values concatenated. Here's a snippet of the output code in an abstract class.

outputString += "<" + classTagName + getAttributes() + "/>";

In my implemented class I've defined this variable in the constructor

classTagName = "input type='radio'";

So how on earth can this produce the output...

<input ...lots of attributes... type="radio" />

The single quotes have become double quotes and the the attributes have been spliced into the middle of my string variable. Obviously, this isn't going to kill me, but I would like to know what's going on. (Before I do something that will kill my program.)
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
  #2 (permalink)  
Old August 19th, 2010, 02:48 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Have you tried it in different browsers? It might be the browser that is cleaning your code perhaps?
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
  #3 (permalink)  
Old August 19th, 2010, 10:19 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

:O OK, I thought you were drinking the koolaid, but I checked it anyway. How on earth did you figure this one!? It's a Firefox thing. So I assume that means I'm good to go and just give the Firefox XHTML an extra look before deploying anything since it may be a bit tweaked?

Here's some of the test results, check it out. In IE and Opera the output is identical but in Firefox, not so much.

Code output:
outputSelectTestsAndPagesUiOutput = "<input type='radio' id='myId' class='mighty mouse' lang='en' xml:lang='en' />";

XHTML output (as copied from view source):
<input id="myId" class="mighty mouse" xml:lang="en" lang="en" type="radio"> (Firefox 2.0)
<input id="myId" class="mighty mouse" xml:lang="en" type="radio" lang="en"> (Firefox 3.6)
<input type='radio' id='myId' class='mighty mouse' lang='en' xml:lang='en' /> (Opera 9.23)
<input type='radio' id='myId' class='mighty mouse' lang='en' xml:lang='en' /> (Opera 10.6)
<input type='radio' id='myId' class='mighty mouse' lang='en' xml:lang='en' /> (IE 6.0)
<input type='radio' id='myId' class='mighty mouse' lang='en' xml:lang='en' /> (IE 8.0)


Code output:
outputSelectTestsAndPagesUiOutput = "< id='myId' class='mighty mouse' > </ >";

XHTML output (as copied from view source):
&lt; id='myId' class='mighty mouse' &gt; <!-- --> (Firefox 2.0)
&lt; id='myId' class='mighty mouse' &gt; <!-- --> (Firefox 3.6)
< id='myId' class='mighty mouse' > </ > (Opera 9.23)
< id='myId' class='mighty mouse' > </ > (Opera 10.6)
< id='myId' class='mighty mouse' > </ > (IE 6.0)
< id='myId' class='mighty mouse' > </ > (IE 8.0)
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
visible/invisible stealthdevil Access VBA 4 December 1st, 2006 05:40 PM
Make visible/invisible stealthdevil Access VBA 6 May 31st, 2006 10:59 AM
Underscore to be invisible jmaronilla Beginning PHP 2 September 15th, 2004 09:37 AM
Preloading invisible forms pavel Pro VB 6 6 April 15th, 2004 09:07 AM
Invisible HyperLink acko ASP.NET 1.x and 2.0 Application Design 2 January 19th, 2004 01:00 PM



All times are GMT -4. The time now is 08:19 AM.


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