Here's something I've never run into before. I'm outputting a string to a literal control, and the string contains several values concatenated. So far so good, I've done that plenty of times. I have an abstract class which has some basic machinery to create an XHTML tag, here's a snippet of the output code.
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.)







I just found out what the problem is. One of the tech guys on the Wrox P2P forum suggested it. I thought he was high, but I had nothing better to test so I gave it a try and he was right. If anyone else wants to take a crack at what's processing the code after the literal is initialized, I'll wait until I log in again (or at least 24 hours) before playing spoiler.

You know you love it.

Bookmarks