473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Could not open in Design view. Place quotes around a <% %>


Am getting this error with the following code, particularly this line:

<%# Check(DataBinder.Eval(Container.DataItem, "broker_id"))%>

I am creating checkboxes and the Check function checks to have that
particular checkbox checked by default. I am not using checkboxlist
because I want to EASILY save data to DB with a comma separated list
which HTML gives you if all the checkboxes have the same name.

<asp:datalist id=DataList1 runat="server" RepeatColumns="4">
<ItemTemplate>
<INPUT type=checkbox name=state_ids id='state_id_<%#
DataBinder.Eval(Container.DataItem, "id")%>' value='<%#
DataBinder.Eval(Container.DataItem, "id")%>' <%#
Check(DataBinder.Eval(Container.DataItem, "broker_id"))%> > <%#
DataBinder.Eval(Container.DataItem, "name")%>
</ItemTemplate>
</asp:datalist>

protected string Check(object x) {
if (x != DBNull.Value)
return(" CHECKED");
else
return("");
}

any ideas?

thanks

-ed
Nov 18 '05 #1
1 2620
The only way to make it work is to change your input type="checkbox into an
<asp:checkbox, use checked='<%# Check(DataBinder.Eval(Container.DataItem,
"broker_id"))%>' and change your function to return true/false

karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Ed West" <we**@westville.com> wrote in message
news:Om**************@TK2MSFTNGP10.phx.gbl...

Am getting this error with the following code, particularly this line:

<%# Check(DataBinder.Eval(Container.DataItem, "broker_id"))%>

I am creating checkboxes and the Check function checks to have that
particular checkbox checked by default. I am not using checkboxlist
because I want to EASILY save data to DB with a comma separated list
which HTML gives you if all the checkboxes have the same name.

<asp:datalist id=DataList1 runat="server" RepeatColumns="4">
<ItemTemplate>
<INPUT type=checkbox name=state_ids id='state_id_<%#
DataBinder.Eval(Container.DataItem, "id")%>' value='<%#
DataBinder.Eval(Container.DataItem, "id")%>' <%#
Check(DataBinder.Eval(Container.DataItem, "broker_id"))%> > <%#
DataBinder.Eval(Container.DataItem, "name")%>
</ItemTemplate>
</asp:datalist>

protected string Check(object x) {
if (x != DBNull.Value)
return(" CHECKED");
else
return("");
}

any ideas?

thanks

-ed

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Eric Osman | last post by:
Hi, I'm looking for a javascript function that will convert input such as this: <CLUB Code=" into this: &lt;CLUB Code=&quot;
1
by: Davef | last post by:
When I try to open design view in VS I get that error. Is there anyway around that? <td vAlign=bottom noWrap align=right background="<%= Application("AppPath") %>/images/BarGradient.gif" > -- ...
1
by: Donnie | last post by:
Hello I'm receiving the following error message when I try to view an aspx page in Design view "Could not open in Design View. Quote values differently inside a '<%... "value" ... %>' block ...
1
by: Maziar Aflatoun | last post by:
Hi everyone, I'm using Visual Studio .NET to create a shopping cart. As soon as I add the following line in my code <td width="25%" align="center" bgcolor="#ffffff"> <input type="button"...
2
by: Rob Meade | last post by:
Hi all, I am getting the above error when I try to flick from HTML to Design view in Visual Studio - I get the jist of the error message, and I know the line of code which it refers to which is...
12
by: Raed Sawalha | last post by:
I have the following table which i can not switcha to design view error message said Could not open in Design view. Quote values differently inside a '<% ...."value"... %>' block. and the...
2
by: Aahz | last post by:
I know this problem has been discussed before but still cannot work it out, here is my code: <span class="popup" onClick = javascript:window.open('fullimage.aspx?id=<%#...
1
by: Nogusta123 | last post by:
Hi, I have had a lot of problems getting web pages, master pages and content pages to render in VS2005 design view the same as they would in Internet Explorer. I did a lot of looking on the...
5
by: dfetrow410 | last post by:
I know the typical fix for this problem, but I am not sure how to fix this line: <a...
5
by: Hank Moss | last post by:
I've been able to get the <qelement and the CSS quotes property to work well together in English, but not in Russian or mixed Russian and English. I probably don't have a firm enough grasp of the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.