Hyper Link in DataGrid

Discussion in 'ASP .Net' started by aroraamit81@gmail.com, Mar 3, 2006.

  1. Guest

    <ItemTemplate>
    <asp:HyperLink CssClass="LinkShort" Runat="server"
    NavigateUrl="TeamUsers.aspx?TeamID=<%#((System.Data.DataRowView)Container.DataItem)["Team_Name"]
    %>">
    <%#((System.Data.DataRowView)Container.DataItem)["Team_Name"]
    %>

    </asp:HyperLink>

    </ItemTemplate>

    What is wrong with the above statements. I gives me a parser error like
    "The server tag is not well formed."

    Any Help?????

    Regards,

    Amit Arora
     
    , Mar 3, 2006
    #1
    1. Advertising

  2. You need to use single quotes on the outer attribute value because you have
    double quotes in the server-side code. Try this?

    <asp:templatecolumn>
    <itemtemplate>
    <asp:hyperlink
    id="HyperLink1"
    runat="server" cssclass="LinkShort"
    navigateurl='TeamUsers.aspx?TeamID=<%#((System.Data.DataRowView)Container.DataItem)["Team_Name"]
    %>'>
    <%#((System.Data.DataRowView)Container.DataItem)["Team_Name"] %>
    </asp:hyperlink></itemtemplate>
    </asp:templatecolumn>

    Ken
    Microsoft MVP [ASP.NET]


    <> wrote in message
    news:...
    > <ItemTemplate>
    > <asp:HyperLink CssClass="LinkShort" Runat="server"
    > NavigateUrl="TeamUsers.aspx?TeamID=<%#((System.Data.DataRowView)Container.DataItem)["Team_Name"]
    > %>">
    > <%#((System.Data.DataRowView)Container.DataItem)["Team_Name"]
    > %>
    >
    > </asp:HyperLink>
    >
    > </ItemTemplate>
    >
    > What is wrong with the above statements. I gives me a parser error like
    > "The server tag is not well formed."
    >
    > Any Help?????
    >
    > Regards,
    >
    > Amit Arora
    >
     
    Ken Cox - Microsoft MVP, Mar 3, 2006
    #2
    1. Advertising

  3. Guest

    Thanks Man......
     
    , Mar 3, 2006
    #3
  4. Or you could also do it in the ItemdataBound
    Patrick

    <> wrote in message
    news:...
    > Thanks Man......
    >
     
    Patrick.O.Ige, Mar 3, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Meheraj shaik via .NET 247

    Hyper link in Datagrid

    Meheraj shaik via .NET 247, May 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,538
  2. k-re
    Replies:
    1
    Views:
    1,739
    Tim S.
    Jun 25, 2003
  3. Yann.K
    Replies:
    9
    Views:
    350
    Nemesis
    Sep 8, 2004
  4. Jonathan  Ellis

    Re: open default MUA with a hyper link

    Jonathan Ellis, Sep 3, 2004, in forum: Python
    Replies:
    2
    Views:
    319
    Thierry S.
    Sep 6, 2004
  5. Alexander Kaplunov

    hyper link in DataGrid

    Alexander Kaplunov, Dec 17, 2003, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    201
    Alexander Kaplunov
    Dec 18, 2003
Loading...

Share This Page