Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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
  #1 (permalink)  
Old August 26th, 2003, 09:08 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default Could not open in design view!!

I had my project working last night. When I tried to open it this morning, it wouldn't show me design for one of the pages. Complains something like this:

Could not open in design view. Place quotes around a '<% %>' block used as an attribute value or within a <SELECT> element

Here is my HTML and script page:

<%@Register tagprefix="FSA" TagName="NavigationBar2" src="NavigationBar2.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="frmLMCAssignments.aspx.vb" Inherits="FSA_1._1.frmLMCAssignments" debug="true"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
.
.
<body
<form
<table
<tr
<td
<asp:datagrid
<columns>
<asp:TemplateColumn HeaderText = "Assigned">
<ItemTemplate>
    <asp:CheckBox ID = "cbAssigned" Runat = "server"
        Checked = <%#DataBinder.Eval(Container.DataItem,"IsAssigned" )%>
    Enabled = False />
    </ItemTemplate>
    </asp:TemplateColumn>
/td>
/tr>
/table>
/form>
/body>


These are the only places where I'm using '<% %>' blocks.

Will appreciate any help.



.
</HTML>
  #2 (permalink)  
Old August 26th, 2003, 09:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , Denmark.
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

Do you have a <SELECT> element...?


  #3 (permalink)  
Old August 26th, 2003, 09:25 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Try this...
Code:
<asp:CheckBox ID = "cbAssigned" Runat = "server"
        Checked="<%#DataBinder.Eval(Container.DataItem,"IsAssigned")%>"
        Enabled="False" />
        I would advise to always put attributes in quotes.

Note regarding this: I think that when you do something like put a Databinder result in a web control attribute value you have to put it in single quotes...
Code:
<asp:CheckBox ID = "cbAssigned" Runat = "server"
        Checked='<%#DataBinder.Eval(Container.DataItem,"IsAssigned")%>'
        Enabled="False" />
        Kind of weird but that is what seems to work.
  #4 (permalink)  
Old August 26th, 2003, 02:47 PM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks planoie, you hit it on the dot.

  #5 (permalink)  
Old March 17th, 2004, 03:22 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, this allows you to see your page in design view, but the resulting HTML checked='true' or checked='false' (with single quotes) does not do what you'd expect in a browser: For example, in my IE 6.0, if all radio buttons are checked='false' the very last one will appear checked. :) IE expects there to be the word checked (without quotations) or not... I don't know how to solve this issue: you can't seem to be able to open the aspx page in design view and have it behave correctly in browser too :).



Similar Threads
Thread Thread Starter Forum Replies Last Post
Report change in Design View echovue Access VBA 4 March 3rd, 2006 04:31 PM
Blank Design View ??? smuger Dreamweaver (all versions) 4 October 11th, 2004 04:40 PM
how to enable the design view yylee Access VBA 2 October 4th, 2004 02:23 PM
Question about form's design view reindeerw Access 15 April 12th, 2004 11:33 PM





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