Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 1st, 2004, 02:09 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Alhambra, ca, USA.
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

  #2 (permalink)  
Old October 1st, 2004, 02:15 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Alhambra, ca, USA.
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

  #3 (permalink)  
Old October 4th, 2004, 09:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
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
  #4 (permalink)  
Old October 4th, 2004, 10:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
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
  #5 (permalink)  
Old October 5th, 2004, 07:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
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
  #6 (permalink)  
Old October 5th, 2004, 02:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:36 PM.


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