Hi, all. I tried to get the existing code for my website (originally
built on .NET 1.1 using VS2003 as the development tool) to compile
within VS2005 for .NET 2.0, but have run into the following problem :
The existing code uses include files (i.e. files that are included
in .aspx pages using the include macro) that contain inline VB
scripting code (for example, <%=myvariable%> or <% if IsValidFlag =
true then %> ) : The error message is "Character '<' , hexadecimal
value 0x3c is illegal in an XML attribute values.
If I remove the offending include file, then I cannot compile it
either because it says it's missing the include file. Also, I have
already set the HTML validation in Tools->Action to HTML 4.01 and
uncheck the "Show Errors" box.
There are other errors complaining about the inline code such as :
"Character '%', hexadecimal value 0x25 is illegal in an XML attribute
"Entity 'nbsp' not defined"
(The error message above is complaining about the " " in the
How do I resolve this problem? Does VS2005 support inline scripting
like this or does it only support inline code that is within the
<script> block? Do I need to restructure the whole site using Master
Pages? Should I rewrite the code so that it doesn't contain inline
Thanks in advance for answering.
short answer - Try just converting the VBScript code to pure VB.Net and see how it does
<%# myVariable %>, with variables being assigned in Page_Load, followed by a Page.DataBind - use helper functions for the inline logic
or - remove the reference in the page to the include file - -
long answer - rewrite with a MasterPage scenario (best choice)
ASPNet101.com - where to look first!
Control Grouper - easily control properties for multiple controls with one control!
Calendar Express - The Best HTML Calendar Generator on the web!
(Please 'Mark as Answer' when it applies)