Link to home
Start Free TrialLog in
Avatar of Éric Moreau
Éric MoreauFlag for Canada

asked on

Could not open in Design view

I have this line in a WebForm
                                                                                    <tr valign="top"
      id="<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>"
      onmouseover="document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='d3d3d3'"
      </tr>


The designer complains with this error:
Could not open in Design View. Quote values differently inside a '<% ... "Value" ...%>' block.

The problem is in the onmouseover line.

Any ideas?
Avatar of mmarinov
mmarinov

Hi emoreau,

this is because a server code is stands in the quotes
try with this lines

<tr valign="top"
     id='<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>'
     onmouseover='document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='d3d3d3''
     </tr>

Regards!
B..M
Avatar of Éric Moreau

ASKER

I am getting a different error:

Could not open in Design View. Place quotes around a '<% %>' block used as an attribute value or within a <SELECT> element.
<tr valign="top"
     id='<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>'
     onmouseover=document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='d3d3d3'
     </tr>

try that
take that out
.style.background='d3d3d3''
praneetha, on this particular line, removing the ' from the beginning and the end is working.

But what about this line:
<td valign="top"
style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px"
width="80"
style="cursor:hand;"
onclick="document.all('spdd').style.display='none';document.all('txtVal').value='<%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>';document.all('spdd2').style.display='none'"><%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>
</td>

(The problem is on the onclick line)
onclick=document.all('spdd').style.display='none';document.all('txtVal').value='<%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>';document.all('spdd2').style.display='none'>
<%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>

try that
I am about to let this problem and pass on other things!!! In fact, this question is not for me (it is for a friend)!

<itemtemplate>
      <tr valign="top"
      id='<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>'
      onmouseover=document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='#d3d3d3'
      >
            <!--onmouseover="document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='d3d3d3'" -->
            <!--onmouseout="document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='white'" -->
            <!--
<td valign="top" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px"
      width="80" style="cursor:hand;" onclick="document.all('spdd').style.display='none';document.all('txtVal').value='<%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>';document.all('spdd2').style.display='none'"><%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %></td>
<td valign="top" align=left style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px"
      width="270" style="cursor:hand;" onclick="document.all('spdd').style.display='none';document.all('txtVal').value='<%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>';document.all('spdd2').style.display='none'"><%# DataBinder.Eval(Container.DataItem, "Description") %></td>
      -->
      </tr>
</itemtemplate>


As you can see, most lines are commented out. As soon as I add the first onmouseover line, this result in the following error:
Could not open in Design View. Place quotes around a '<% %>' block used as an attribute value or within a <SELECT> element.
AerosSaga, I tried to remove the .style.background='#d3d3d3' and I have the same problem.
   <!--onmouseover="document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='d3d3d3'" -->
          <!--onmouseout="document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='white'" -->


for which tag r u adding mouseover ....it should be inbetween < >
praneetha, thank you for your patience.

Here is a cut-down version of my last post (removing all commented lines). Even with this I have the error.

<itemtemplate>
     <tr valign="top"
     id='<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>'
     onmouseover=document.all('<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>').style.background='#d3d3d3'
     >
     </tr>
</itemtemplate>

>>for which tag r u adding mouseover ....it should be inbetween < >

I don't understand what you are asking. I think that everything that should be between  <> are in!
<tr valign="top"
     id='<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>'
     onmouseover="this.style.background='#d3d3d3' ">
    </tr>

try that
For this line, "this" is working. But then I have a problem on the following lines (in TDs):

<itemtemplate>
     <tr valign="top"
     id='<%# DataBinder.Eval(Container.DataItem, "idNatureComptable") %>'
     onmouseover=this.style.background='#d3d3d3'
     onmouseout=this.style.background='white'" >

<td valign="top" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px"
     width="80" style="cursor:hand;" onclick="document.all('spdd').style.display='none';document.all('txtVal').value='<%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>';document.all('spdd2').style.display='none'"><%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>
</td>

<td valign="top" align=left style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px"
     width="270" style="cursor:hand;" onclick="document.all('spdd').style.display='none';document.all('txtVal').value='<%# DataBinder.Eval(Container.DataItem, "CompteGeneral") %>';document.all('spdd2').style.display='none'"><%# DataBinder.Eval(Container.DataItem, "Description") %>
</td>

     </tr>
</itemtemplate>
emoreau,

i suggest you to tell your friend to not give this problem attention - it is a problem with VS.NET and the time spent in searching the problem are useless

Regards!
B..M
I cannot view this page in the designer! That's why we are looking for the solution.
SOLUTION
Avatar of mmarinov
mmarinov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No solution came out!
One Solution is to use a package like dreamweaver to view the design view and Visual Studio to edit the code.  Saves you changing the code.
It doesn't really help. It is the imbrication of many single/double quotes combination that causes the error!