www.webdeveloper.com
Results 1 to 1 of 1

Thread: Eval NavigateUrl

  1. #1
    Join Date
    Mar 2009
    Posts
    61

    Eval NavigateUrl

    Code:
    <asp:Label ID="Label1" runat="server" Text='<%# Eval("NavigateUrl") %>'></asp:Label>
    <%# Eval("NavigateUrl") == "/" ? "<span>" + Eval("Text") + "</span>" : "<a href=\"" + Eval("NavigateUrl") + "\">" + Eval("Text") + "</a>"%>
    The label above displays a /, but the next line displays the anchor tag instead of the span. Any ideas why??

    ------------------------------------------------------------------------------------------------------------

    I finally figured it out.
    Corrected Code:
    Code:
    Eval("NavigateUrl").ToString() == "/"
    Last edited by yssirhc; 06-17-2014 at 10:58 AM. Reason: solved

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles