Error: Could Not Open With Design View

G

Guest

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 line which make the error is anchor but i cannot make it work.


<TABLE id="tblDocList" dir="<%#strLangDir%>" style="DISPLAY:inline"
cellSpacing="0" cellPadding="0" border="0" width="150">
<TR>
<th width="4">
<img src="MailTools/images/Icons/doc.jpg"></th>
<TD align="left" width="2"><INPUT onclick="refresh(this);" id="delmsg"
type="checkbox"></TD>
<TD align="left" colSpan="2"><a
href="javascript:__doPostBack('<%=this.ClientID%>:lbtnAction','showmsg,<%#
DataBinder.Eval(Container,"DataItem.id") %>')">
<%# DataBinder.Eval(Container, "DataItem.subject") %>
</a>
</TD>
</TR>
</TABLE>
 
J

JohnFol

The line causing the problem is

<a
href="javascript:__doPostBack('<%=this.ClientID%>:lbtnAction','showmsg,<%#
DataBinder.Eval(Container,"DataItem.id") %>')">
<%# DataBinder.Eval(Container, "DataItem.subject") %>

If you get rid of the DataBind stuff you actually get this

<a href="javascript:__doPostBack('ID','showmsg, ')">

I think the last ' is causing the problem
 
G

Guest

i removed the ' with no avai and also i tried will following formats and
still have the same problem :

DataBinder.Eval(Container,"DataItem.id") %>)">
and

<a
href="javascript:__doPostBack('<%=this.ClientID%>:lbtnAction',showmsg,<%#
DataBinder.Eval(Container,"DataItem.id") %>)">

i think the problem comes from ,"DataItem.id" but how to handle this in HTML
 
R

recoil

if the page ois accessible from the outside then run the output
throughthe W3C validator
http://validator.w3.org/ You can use that to pinpoint the problem.
Alternatively you can paste the output into a new html file in VS.NET
and see if anything shows up there. Sometimes troubleshooting the
output is easier then trying to troubleshoot the input
 
K

Ken Dopierala Jr.

Hi,

Your problem is here:

href="javascript:__doPostBack('<%=this.ClientID%>:lbtnAction','showmsg,<%#
DataBinder.Eval(Container,"DataItem.id") %>')"

You have the entire javascript line in double quotes (") but you also have
DataItem.id in double quotes ("). You can not nest double quotes like that.
Good luck! Ken.
 
G

Guest

ok what do you suggest to do because if I remove the double quotes from
DataBind like this <%#DataBinder.Eval(Container,DataItem.id) %> the page will
generate an error at run time
 
K

Ken Dopierala Jr.

Hi,

This might work. Create a Public function in your code-behind :

Public Function BuildAString(ByVal strClientID As String, _
ByVal strDataID As String) As String
Return """javascript:__doPostBack('" + strClientID + _
":lbtnAction','showmsg," + strDataID + "');"""
End Function

Then call that function from your .aspx page to assign that string to the
href :

href=<%# Me.BuildAString(this.ClientID, DataBinder.Eval(Container,
"DataItem.id"))%>

That should do it for you. I havn't tested it though so look out for typos,
unmatched quotes, etc. Good luck! Ken.
 
G

Guest

I'll get mad still have same problem i did what u suggest like following but
still can not switch to design view
<a href=<%# this.BuildABindString(DataBinder.Eval(Container,"DataItem.id"))%>>
<%# DataBinder.Eval(Container, "DataItem.subject") %>
</a>

the problem with "DataItem.id" i cannot remove the " because the page will
crash ,what should I do????
 
K

Ken Dopierala Jr.

Hi,

I don't know what to tell you. Post all the code is all I can say. Maybe
try to take a step back from the problem, work on something else, and then
come back to it. This is one of those small little things, that once you
fix it, you are going to wonder how the heck you missed it. Good luck!
Ken.
 
G

Guest

this is the while ascx code of , it is inside a user control not a page

<div id="divInboxFolder" align="center" runat="server">
<DIV align="center" runat="server">
<TABLE id="Table2" cellSpacing="0" cellPadding="0" width="576" border="0">
<!-- fwtable fwsrc="Untitled" fwbase="Browse2.jpg" fwstyle="Dreamweaver"
fwdocid = "742308039" fwnested="0" -->
<TR>
<TD colSpan="3"><IMG height="6" alt=""
src="MailTools/Images/BrowseImages/Browse2_r1_c1.jpg" width="576"
border="0" name="Browse2_r1_c1"></TD>
</TR>
<TR>
<TD width="8"><IMG height="34" alt=""
src="MailTools/Images/BrowseImages/Browse2_r2_c1.jpg" width="8"
border="0" name="Browse2_r2_c1"></TD>
<TD width="560"
background="MailTools/Images/BrowseImages/Browse2_r2_c2.jpg">
<TABLE id="Table6" cellSpacing="0" cellPadding="0" width="560"
border="0">
<TR>
<TH style="HEIGHT: 14px" vAlign="top" scope="col" align="left"
width="2">
<IMG height="8" src="images/spacer.gif" width="2"></TH>
<TH style="WIDTH: 137px; HEIGHT: 14px" vAlign="middle" scope="col"
align="left" width="137"
colSpan="3">
<uc1:mailboxqouta id="oMailBoxQouta1"
runat="server"></uc1:mailboxqouta></TH>
<TH style="WIDTH: 178px; HEIGHT: 14px" vAlign="middle" scope="col"
align="left" width="178">
<IMG height="8" src="images/spacer.gif" width="4"></TH>
<TH style="HEIGHT: 14px" vAlign="middle" scope="col" align="left">
</TH>
<TH style="HEIGHT: 14px" vAlign="middle" scope="col" align="left"
width="4">
<IMG height="8" src="images/spacer.gif" width="4"></TH>
<TH style="HEIGHT: 14px" vAlign="middle" scope="col" align="center"
width="67">
Views<BR>
<IMG id=imgView
onmouseover="MM_swapImage('Image15','','MailTools/images/<%=strImgName_New_O%>',1)"
style="CURSOR: hand" onclick=DisplayViews(); onmouseout=MM_swapImgRestore()
height=10 src="MailTools/Resources/desc.gif" width=10 border=0 name=Image16
<TH style="HEIGHT: 14px" vAlign="middle" scope="col" align="right"
width="67">
<IMG id=imgAddNew
onmouseover="MM_swapImage('Image15','','MailTools/images/<%=strImgName_New_O%>',1)"
style="CURSOR: hand"
onclick="javascript:__doPostBack('lbtnAction','Document_New')"
onmouseout=MM_swapImgRestore() height=23
src="MailTools/images/ said:
<TH style="HEIGHT: 14px" vAlign="top" scope="col" align="right"
width="2">
<IMG height="8" src="images/spacer.gif" width="2"><IMG height="8"
src="images/spacer.gif" width="2"></TH></TR>
</TABLE>
</TD>
<TD width="8"><IMG height="34" alt=""
src="MailTools/Images/BrowseImages/Browse2_r2_c3.jpg" width="8"
border="0" name="Browse2_r2_c3"></TD>
</TR>
<TR>
<TD colSpan="3"><IMG height="6" alt=""
src="MailTools/Images/BrowseImages/Browse2_r3_c1.jpg" width="576"
border="0" name="Browse2_r3_c1"></TD>
</TR>
</TABLE>
</DIV>
<DIV id="divInbox" align="center" runat="server">
<TABLE id="InboxTable" cellSpacing="0" cellPadding="0" width="576"
border="0">
<TR>
<TH vAlign="top" scope="col" width="5"
background="MailTools/images/Inbox_r8_c1.jpg">
<IMG height="26" alt="" src="MailTools/images/Inbox_r5_c1.jpg"
width="9" border="0" name="Inbox_r5_c1"></TH>
<TH vAlign="bottom" scope="col" width="558">
<DIV align="left"><asp:datagrid id=dgInbox dir="<%#strLangDir%>"
runat="server" EnableViewState="False" Font-Names="Arial" Font-Size="10pt"
GridLines="None" BorderWidth="0px" CellPadding="1"
ItemStyle-CssClass="InboxRow" AutoGenerateColumns="False" AllowSorting="True"
Width="100%">
<ItemStyle Wrap="False" BorderWidth="11px" BorderStyle="Solid"
CssClass="tableCell"></ItemStyle>
<HeaderStyle Height="26px" CssClass="tableHeaderCell"></HeaderStyle>
<Columns>
<asp:BoundColumn></asp:BoundColumn>
<asp:BoundColumn Visible="False"></asp:BoundColumn>
<asp:BoundColumn DataField="subject" SortExpression="subject"
HeaderText="Subject"></asp:BoundColumn>
<asp:BoundColumn DataField="date" SortExpression="date"
HeaderText="Date"></asp:BoundColumn>
<asp:BoundColumn Visible="False"
DataField="hasattachment"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="id"></asp:BoundColumn>
<asp:BoundColumn DataField="filesize" SortExpression="filesize"
HeaderText="Size"></asp:BoundColumn>
</Columns>
</asp:datagrid></DIV>
</TH>
<TH vAlign="top" scope="col" width="5"
background="mailtools/Images/Inbox_r8_c3_.jpg">
<IMG height="26" alt="" src="MailTools/images/Inbox_r5_c3.jpg"
width="9" border="0" name="Inbox_r5_c3"></TH></TR>
<TR>
<TD vAlign="top" width="5"
background="MailTools/images/Inbox_r8_c1.jpg"></TD>
<TD vAlign="bottom" align="center" width="558" background=""><DIV
id="divListView" runat="server" ms_positioning="FlowLayout"><asp:repeater
id="rpListView" runat="server">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<TABLE id="tblDocList" style="FONT-WEIGHT: bold;FONT-SIZE: 9pt;
FONT-FAMILY: Tahoma;DISPLAY:inline" dir="<%#strLangDir%>" cellSpacing="0"
cellPadding="0" border="0" width="150">
<TR>
<th width="4">
<img src="MailTools/images/Icons/doc.jpg"></th>
<TD align="left" width="2"><INPUT onclick="refresh(this);"
id="delmsg" type="checkbox"></TD>
<TD align="left" colSpan="2">
<a
href="javascript:__doPosBack('<%=this.ClientID%>:lbtnAction','showmsg,<%#
DataBinder.Eval(Container,"DataItem.id")%>')">
<%# DataBinder.Eval(Container, "DataItem.subject") %>
</a>
</TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:repeater></DIV>
</TD>
<TD vAlign="top" width="5"
background="mailtools/Images/Inbox_r8_c3_.jpg"></TD>
</TR>
<TR>
<TD align="center" colSpan="3">
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="576"
border="0"> <!-- fwtable fwsrc="Compose.png" fwbase="Compose.jpg"
fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<TR>
<TD rowSpan="3"><IMG height="26" alt=""
src="MailTools/images/Compose_r10_c1.jpg" width="8" border="0"
name="Compose_r10_c1"></TD>
<TD><IMG height="2" alt="" src="MailTools/images/Compose_r10_c2.jpg"
width="560" border="0"
name="Compose_r10_c2"></TD>
<TD rowSpan="3"><IMG height="26" alt=""
src="MailTools/images/Compose_r10_c3.jpg" width="8" border="0"
name="Compose_r10_c3"></TD>
</TR>
<TR>
<TD width="560" background="MailTools/images/Compose_r11_c2.jpg"
height="22">
<TABLE id="Table5" cellSpacing="0" cellPadding="0" width="558"
border="0">
<TR>
<TH vAlign="bottom" scope="col" align="center" width="18">
<IMG title="Click to Delete the Selected Documents"
style="CURSOR: hand" onclick="cdelete('en')"
height="17" src="MailTools/images/DeleteIcon.jpg" width="18"
border="0"></TH>
<TH scope="col" width="3">
<IMG height="1" src="MailTools/Images/spacer.gif" width="1"></TH>
<TH vAlign="middle" scope="col" align="center" width="5">
<IMG height="1" src="MailTools/Images/spacer.gif" width="1"><IMG
height="16" src="MailTools/images/separator.jpg" width="1"></TH>
<TH scope="col" width="3">
<IMG height="1" src="MailTools/Images/spacer.gif" width="1"></TH>
<TH vAlign="middle" scope="col" align="center">
<DIV align="left"></DIV>
</TH>
<TH vAlign="middle" scope="col" align="center">
<DIV id="nav" dir="ltr" align="center" runat="server"
ms_positioning="FlowLayout"></DIV>
</TH>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD><IMG height="2" alt="" src="MailTools/images/Compose_r12_c2.jpg"
width="560" border="0"
name="Compose_r12_c2"></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<DIV align="center" runat="server"><asp:linkbutton id="lbtnAction"
runat="server" Visible="False">LinkButton</asp:linkbutton></DIV>
</DIV>
</div>
<div id="NoMsg" dir="ltr" style="HEIGHT: 115px" align="center"
runat="server" Visible="False"
enableViewState="false">
<P><BR>
<BR>
<asp:label id="lblNoMsg" runat="server"
CssClass="StanderdFont"></asp:label></P>
</div>
<TABLE id="tblViews" style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP:
#ffffff 1px solid; DISPLAY: none; FONT-WEIGHT: bold; FONT-SIZE: 9pt;
BORDER-LEFT: #ffffff 1px solid; WIDTH: 88px; CURSOR: hand; BORDER-BOTTOM:
#ffffff 1px solid; FONT-FAMILY: Tahoma; HEIGHT: 78px"
cellSpacing="0" cellPadding="0" width="88" align="left" border="0">
<TR>
<TD style="CURSOR: hand" align="center" height="5"></TD>
</TR>
<TR>
<TD id="tdDetailView" align="center" height="12"><A
onclick="parent.ChangeView(0)" href="#">Detail
View</A></TD>
</TR>
<TR>
<TD id="tdIconView" style="CURSOR: hand" onclick="parent.ChangeView(1)"
align="center"
height="12">Icon View</TD>
</TR>
<TR>
<TD id="tdListView" style="CURSOR: hand" align="center" height="12"><A
onclick="parent.ChangeView(2)" href="#">List
View</A></TD>
</TR>
</TABLE>
<P><INPUT id="hdnViewType" type="hidden" name="hdnViewType" runat="server">
<INPUT id="allmsg" style="DISPLAY: none" type="checkbox">
</P>
<BR>
 
K

Ken Dopierala Jr.

Hi,

You can not do this:

href="javascript:__doPostBack('<%=this.ClientID%>:lbtnAction','showmsg,<%#
DataBinder.Eval(Container,"DataItem.id")%>');"

You have been told that already. You have double quotes around the entire
string, then inside of those you also have double quotes around DataItem.id.
You can not nest quotes. This is the same problem you started with. I
already told you how to fix it. Here is the solution again, if you do this
you will be set to go (all you need to do is cut and paste the function into
your code behind and the href in place of the href shown above):

Create a Public function in your code-behind :

Public Function BuildAString(ByVal strClientID As String, _
ByVal strDataID As String) As String
Return """javascript:__doPostBack('" + strClientID + _
":lbtnAction','showmsg," + strDataID + "');"""
End Function

Then call that function from your .ascx page to assign that string to the
href :

href=<%# Me.BuildAString(this.ClientID, DataBinder.Eval(Container,
"DataItem.id"))%>

Good luck! Ken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top