PRB: The Editor is Unable to Switch to Design View Because There is Unquoted ASP Script in an Attribute Value or Inside a <SELECT> Tag.

ID: Q215337


The information in this article applies to:
  • Microsoft Visual InterDev, version 6.0


SYMPTOMS

When Authoring Active Server Pages in Visual InterDev 6.0 using the Source Editor, you may receive the following error:

The editor is unable to switch to Design view because there is unquoted ASP script in an attribute value or inside a <select> tag.
Embedded Active Server Pages (ASP) code within certain HTML tags will produce the above error message when switching to Design view. Inserting the following code into an ASP page from Source Editor and then switching to Design view will reproduce this problem:

<SELECT>
<OPTION value="<%=OptionValue1%>">Option 1</OPTION>
</SELECT> 


CAUSE

The Design Editor does not handle ASP script within certain HTML tags. Before switching to Design view, the Source Editor examines your code for embedded ASP script within HTML tags and will display the error message above and prevent you from switching to Design view if it finds embedded ASP script within certain HTML tags.


RESOLUTION

To work around this issue, you will need to Response.Write out the HTML that contains the embedded ASP. This will enable you to switch to Design view; however, the HTML control will not appear on the page. The following code is an example:


<SELECT>
<%
   Response.Write "<SELECT>"
   Response.Write "<OPTION value=" & OptionValue1 & "> Option 1</OPTION>"
   Response.Write "</SELECT>"
%>
</SELECT> 


STATUS

This behavior is by design.

Additional query words:

Keywords : kbEditor kbide kbVisID600 kbGrpASP
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: October 5, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.