Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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
 
Old October 1st, 2004, 02:09 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataList <a Href> Question in Roles.aspx

Hello
The code for Roles.aspx works fine but I can't view the code in Design view cuz I get an error: "Could Not open in Design View. Quote value differently inside a'<%..."value"...%>'block"
  How do I correct this error?

Code that works:
<asp:DataList id="RoleList" runat="server">
<ItemTemplate>
<a href="EditRole.aspx?RoleID=<%# DataBinder.Eval(Container.DataItem, "RoleID") %>"><%# DataBinder.Eval(Container.DataItem, "Description") %></a><br/>
</ItemTemplate>
</asp:DataList>


Can someone correct this code so I can see it in Design View. Thanks

 
Old October 1st, 2004, 02:15 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also when I tried <a href='EditRole.aspx?RoleID=<%# DataBinder.Eval(Container.DataItem, "RoleID") %>'>
 I can see in Design View but I get: "Error Creating Control" for the DataList. Please help

 
Old October 4th, 2004, 09:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Try making it a server control:

<asp:Hyperlink id="id" runat="server" NavigateUrl='EditRole.aspx?RoleID=<%# %>'>

Brian
 
Old October 4th, 2004, 10:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is due to a bug in Visual Studio. The fix you made to change one set of quotes to single, instead of double, is a commonly used work-around. This work-around doesn't always work in every case, as you saw here.

Most of us just settle for not seeing every web form in the designer. Since flow layout is used in this application, the Web Form designer is of limited use anyway. The authors of ThePhile did most of the .aspx pages "by hand" in the HTML view.

I was plesantly surprised how good the whole site looks with Mozilla-style browsers. This is an indicator that the authors spent a lot of time editting the HTML code. It never looks this good in Mozilla if you just plop down components in the Web form designer.

Eric
 
Old October 5th, 2004, 07:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

When I embed this databinding notation in server controls, I haven't had any problems viewing the web forms.

Brian
 
Old October 5th, 2004, 02:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem is only when you have nested double quotes. The Web Form designer isn't smart enough to understand this syntax, although it is a valid syntax.

Sometimes changing the outer set of quotes to single (the ones that get sent down to HTML) will work because VS doesn't see a double set of double quotes. This doesn't work for one of the pages in ThePhile (I don't remember which one right now).

This is a frequent question in the ASP.NET newsgroup. I haven't tried this in the beta for ASP.NET 2, but it may be fixed. I want to try this when I get some free time.

Eric





Similar Threads
Thread Thread Starter Forum Replies Last Post
Including XSL in an <a href> graywoodhouse XSLT 2 November 12th, 2004 06:08 AM
<href> causing problems mahulda ASP.NET 1.0 and 1.1 Basics 5 July 15th, 2004 12:15 PM





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