error with hyperlink control and eval binding sentence

Last post 12-26-2009 10:31 AM by tugberk_ugurlu_. 4 replies.

Sort Posts:

  • error with hyperlink control and eval binding sentence

    11-07-2009, 12:07 PM
    • Member
      154 point Member
    • reguapo
    • Member since 04-06-2006, 5:44 PM
    • Posts 47

    i am using and hyperlink server control like this:

    <asp:HyperLink NavigateUrl="~/Administracion/Usuarios/InformacionUsuario.aspx?user=<%# Eval("UserName") %>" runat="server">
    <%# Eval("UserName") %>
    </asp:HyperLink>

    but i am having the following error:

    Server Error in '/Gerisoft.Website' Application.

    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: The server tag is not well formed.

    Source Error:

    Line 51:                         Usuario</HeaderTemplate>
    Line 52: <ItemTemplate>
    Line 53: <asp:HyperLink NavigateUrl="~/Administracion/Usuarios/InformacionUsuario.aspx?user=<%# Eval("UserName") %>" runat="server">
    Line 54: <%# Eval("UserName") %>
    Line 55: </asp:HyperLink>

    and when i use and <a href> html control it works fine.

    <a href="../Usuarios/InformacionUsuario.aspx?user=<%# Eval("UserName") %>">
                                <%# Eval("UserName") %>
    </a>


    any help?

  • Re: error with hyperlink control and eval binding sentence

    11-07-2009, 12:26 PM
    Answer
    • All-Star
      27,488 point All-Star
    • PeteNet
    • Member since 01-21-2009, 6:15 PM
    • Posts 3,891

    use this:

    NavigateUrl='<%# String.Format("~/Administracion/Usuarios/InformacionUsuario.aspx?user={0}", Eval("UserName")) %>'

    Regards,
    Peter
  • Re: error with hyperlink control and eval binding sentence

    11-07-2009, 1:37 PM
    Answer
    • All-Star
      60,921 point All-Star
    • anas
    • Member since 09-21-2006, 8:31 AM
    • Palestinian Territory, Occupied
    • Posts 6,865
    • Moderator

    OR this:

    NavigateUrl='<%#Eval("UserName","~/Administracion/Usuarios/InformacionUsuario.aspx?user={0}") %>'

    Regards,

    Anas Ghanem | Blog

  • Re: error with hyperlink control and eval binding sentence

    11-10-2009, 4:18 PM
    • Member
      154 point Member
    • reguapo
    • Member since 04-06-2006, 5:44 PM
    • Posts 47

    thanks for both of u, i test both answers and work, thanks again

  • Re: error with hyperlink control and eval binding sentence

    12-26-2009, 10:31 AM

    Hi there ! I would like to use two querystring and what Can I do for that. the below one doesn't work;

    NavigateUrl='<%# String.Format("~/Administracion/Usuarios/InformacionUsuario.aspx?user={0}&location={0}", Eval("UserName"), ("location")) %>'

    thanks !

    Tugberk Ugurlu (WWD 2008 Express Edition / VB)
Page 1 of 1 (5 items)