I don't know how familiar you are with ASP.NET but it is not some sort
of XML. It is code behind the page, which ASP.NET just happens to allow
you to include in the same file as the page.
Yes, but what you posted isn't just the C#, it's the page (or at least a
portion of it). And the C# doesn't get interpreted except in the context
of that page. Maybe the page is HTML instead of XML, but the basic
behavior is still applicable. It's not just C#, and you can't ignore the
fact that the C# is part of a larger document.
It is C# code in every respect and there is no limitation on strings
just because the code is place in an ASP.NET page.
It is obviously _not_ "C# code in every respect". The string you posted
works fine in a regular .cs file in a normal project, and the
more-complete code example you posted would definitely _not_ compile in a
regular .cs file in a normal project.
Just because your HTML/XML happens to include C# code, that doesn't mean
it's "C# code in every respect". If anything, I would think your
situation is definitive proof that the ASP.NET code you've got is not "C#
code in every respect". If it were, you wouldn't be having this problem.
My guess is it is a bug. But perhaps I should repost the issue in the
ASP.NET group.
Yes, I think you should. Given that the problem is not a C# problem, but
rather has something to do with the fact that you're doing ASP.NET, I
think that would be a much more appropriate place to get help. I think
you're wrong about it being a bug, but I simply don't know ASP.NET and in
fact I suspect most of the people who read this newsgroup don't. You'll
get much better advice going straight to the people who do this stuff on a
regular basis.
Pete