Wrox Programmer Forums
|
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 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 August 19th, 2010, 02:39 AM
Friend of Wrox
 
Join Date: Jun 2007
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.
 
Old August 19th, 2010, 02:48 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
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?
 
Old August 19th, 2010, 10:19 PM
Friend of Wrox
 
Join Date: Jun 2007
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.





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





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