Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird Error - Cannot Get into Design View

Status
Not open for further replies.

yu217171

Programmer
Aug 2, 2002
203
CA
Hi everyone,

I cannot get into Design View after I insert this piece of code.

<asp:templatecolumn visible=False headertext="Edit Comments">
<edititemtemplate>
<a href="javascript:void window.open('comments.aspx?reqID=<%#DataBinder.Eval (Container.DataItem, "RequestID")%>','test','width=500 height=500')">Edit</a>
</edititemtemplate>
</asp:templatecolumn>

The error I get says:

"Could not open in Design view. Quote values differently inside a '<% ... "value" ... %>' block.

I can compile just fine and everything seems fine, except I cannot get into design mode. Anyone come across this before?

Keith
 
yep....someone suggested switching all double quotes to single...i know there is another post in this forum regarding this issue...search to see if you can find it...

dlc
 
You can't actually format asp.net server-side code that way (hopefully something they'll fix in 2.0). The easiest way that I've found around this is to stick it all in a function:

Code:
protected string GetEditUrl(int requestID)
{
    return "javascript:void window.open('comments.aspx?reqID=" + requestID.ToString() + "', 'test', 'width=500, height=500')";
}

Code:
<asp:templatecolumn visible=False headertext="Edit Comments">
    <edititemtemplate>
        <a href='<%# this.GetEditUrl((int)DataBinder.Eval(Container,"DataItem.requestID")) %>'>Edit</a>
    </edititemtemplate>
</asp:templatecolumn>

Hope that helps

-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
 
AtomicChip,

That's what I did to get around it. I wrote a function and bound it to the column.

Thanks again,

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top