Trying to create a hyperlink

Discussion in 'ASP .Net Web Controls' started by Wayne Wengert, Apr 1, 2004.

  1. I am trying to create a hyperlink which calls a specific page and passes
    some variables. I am getting an error message on the code section below. The
    error states that "the server tag is not well formed". I suspect it is my
    syntax? I know the data fields are OK as they display fine in the other
    cells.


    =====================================================
    <td>
    <asp:HyperLink id="editlink" runat="server"
    Text = "Edit"
    NavigateURL= "evaljudge.asp?name=" &
    <%#Container.DataItem("JudgeName")%> & "&caption=" &
    <%#Container.DataItem("Caption")%>
    </asp:HyperLink>
    </td>
    <td>
    <%#Container.DataItem("JudgeName")%>
    </td>
    <td align="center">
    <%#Container.DataItem("Caption")%>
    </td>
     
    Wayne Wengert, Apr 1, 2004
    #1
    1. Advertising

  2. Hi Wayne,

    The error is right. Here's how the tag should look:

    <asp:HyperLink id="editlink" runat="server"
    Text = "Edit"
    NavigateURL=
    "evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption=<%#Containe
    r.DataItem("Caption")%>


    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.


    --------------------
    >From: "Wayne Wengert" <>
    >Subject: Trying to create a hyperlink
    >Date: Thu, 1 Apr 2004 09:31:31 -0700
    >Lines: 25
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:19884
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >I am trying to create a hyperlink which calls a specific page and passes
    >some variables. I am getting an error message on the code section below.

    The
    >error states that "the server tag is not well formed". I suspect it is my
    >syntax? I know the data fields are OK as they display fine in the other
    >cells.
    >
    >
    >=====================================================
    ><td>
    > <asp:HyperLink id="editlink" runat="server"
    > Text = "Edit"
    > NavigateURL= "evaljudge.asp?name=" &
    ><%#Container.DataItem("JudgeName")%> & "&caption=" &
    ><%#Container.DataItem("Caption")%>
    > </asp:HyperLink>
    ></td>
    ><td>
    > <%#Container.DataItem("JudgeName")%>
    ></td>
    ><td align="center">
    > <%#Container.DataItem("Caption")%>
    ></td>
    >
    >
    >
    >
     
    Jim Cheshire [MSFT], Apr 1, 2004
    #2
    1. Advertising

  3. Jim;

    Thanks for the response but that still generates the same error. I think I
    see the way you were going and I'll experiment some more - I suspect the
    double quotes are causing a problem.

    Wayne


    "Jim Cheshire [MSFT]" <> wrote in message
    news:hy2Cz$...
    > Hi Wayne,
    >
    > The error is right. Here's how the tag should look:
    >
    > <asp:HyperLink id="editlink" runat="server"
    > Text = "Edit"
    > NavigateURL=
    >

    "evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption=<%#Containe
    > r.DataItem("Caption")%>
    >
    >
    > Jim Cheshire, MCSE, MCSD [MSFT]
    > ASP.NET
    > Developer Support
    >
    >
    > This post is provided "AS-IS" with no warranties and confers no rights.
    >
    >
    > --------------------
    > >From: "Wayne Wengert" <>
    > >Subject: Trying to create a hyperlink
    > >Date: Thu, 1 Apr 2004 09:31:31 -0700
    > >Lines: 25
    > >X-Priority: 3
    > >X-MSMail-Priority: Normal
    > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > >Message-ID: <>
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    > >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    > >Xref: cpmsftngxa06.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webcontrols:19884
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > >
    > >I am trying to create a hyperlink which calls a specific page and passes
    > >some variables. I am getting an error message on the code section below.

    > The
    > >error states that "the server tag is not well formed". I suspect it is my
    > >syntax? I know the data fields are OK as they display fine in the other
    > >cells.
    > >
    > >
    > >=====================================================
    > ><td>
    > > <asp:HyperLink id="editlink" runat="server"
    > > Text = "Edit"
    > > NavigateURL= "evaljudge.asp?name=" &
    > ><%#Container.DataItem("JudgeName")%> & "&caption=" &
    > ><%#Container.DataItem("Caption")%>
    > > </asp:HyperLink>
    > ></td>
    > ><td>
    > > <%#Container.DataItem("JudgeName")%>
    > ></td>
    > ><td align="center">
    > > <%#Container.DataItem("Caption")%>
    > ></td>
    > >
    > >
    > >
    > >

    >
     
    Wayne Wengert, Apr 1, 2004
    #3
  4. If I code it like this I don't get errors but instead of the values from the
    datasource I get the actual streing such as"

    evaljudge.asp?name=
    <%#Container.DataItem('JudgeName')%>&caption=<%#Container.DataItem('Caption'
    )%>" >

    How can I get the values from the <%#Container.DataItem("xxx") %> calls?

    =================== Code Snippett ===============
    <td>
    <asp:HyperLink id="XX" runat="server" Text = "Edit"
    NavigateURL= "evaljudge.asp?name=
    <%#Container.DataItem('JudgeName')%>&caption=<%#Container.DataItem('Caption'
    )%>" >
    </asp:HyperLink>
    </td>
    <td>
    <%#Container.DataItem("JudgeName")%>
    </td>
    <td align="center">
    <%#Container.DataItem("Caption")%>
    </td>

    "Wayne Wengert" <> wrote in message
    news:...
    > Jim;
    >
    > Thanks for the response but that still generates the same error. I think I
    > see the way you were going and I'll experiment some more - I suspect the
    > double quotes are causing a problem.
    >
    > Wayne
    >
    >
    > "Jim Cheshire [MSFT]" <> wrote in message
    > news:hy2Cz$...
    > > Hi Wayne,
    > >
    > > The error is right. Here's how the tag should look:
    > >
    > > <asp:HyperLink id="editlink" runat="server"
    > > Text = "Edit"
    > > NavigateURL=
    > >

    >

    "evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption=<%#Containe
    > > r.DataItem("Caption")%>
    > >
    > >
    > > Jim Cheshire, MCSE, MCSD [MSFT]
    > > ASP.NET
    > > Developer Support
    > >
    > >
    > > This post is provided "AS-IS" with no warranties and confers no rights.
    > >
    > >
    > > --------------------
    > > >From: "Wayne Wengert" <>
    > > >Subject: Trying to create a hyperlink
    > > >Date: Thu, 1 Apr 2004 09:31:31 -0700
    > > >Lines: 25
    > > >X-Priority: 3
    > > >X-MSMail-Priority: Normal
    > > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > > >Message-ID: <>
    > > >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > > >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    > > >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    > > >Xref: cpmsftngxa06.phx.gbl

    > > microsoft.public.dotnet.framework.aspnet.webcontrols:19884
    > > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > > >
    > > >I am trying to create a hyperlink which calls a specific page and

    passes
    > > >some variables. I am getting an error message on the code section

    below.
    > > The
    > > >error states that "the server tag is not well formed". I suspect it is

    my
    > > >syntax? I know the data fields are OK as they display fine in the other
    > > >cells.
    > > >
    > > >
    > > >=====================================================
    > > ><td>
    > > > <asp:HyperLink id="editlink" runat="server"
    > > > Text = "Edit"
    > > > NavigateURL= "evaljudge.asp?name=" &
    > > ><%#Container.DataItem("JudgeName")%> & "&caption=" &
    > > ><%#Container.DataItem("Caption")%>
    > > > </asp:HyperLink>
    > > ></td>
    > > ><td>
    > > > <%#Container.DataItem("JudgeName")%>
    > > ></td>
    > > ><td align="center">
    > > > <%#Container.DataItem("Caption")%>
    > > ></td>
    > > >
    > > >
    > > >
    > > >

    > >

    >
    >
     
    Wayne Wengert, Apr 1, 2004
    #4
  5. Hi Wayne,

    Sorry about that. I didn't see the double quotes. To correct that, simply
    enclose the attribute in single quotes. For example:

    NavigateURL='evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption
    =<%#Container.DataItem("Caption")%>'

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: "Wayne Wengert" <>
    >References: <>

    <hy2Cz$>
    >Subject: Re: Trying to create a hyperlink
    >Date: Thu, 1 Apr 2004 12:50:45 -0700
    >Lines: 78
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:19889
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >Jim;
    >
    >Thanks for the response but that still generates the same error. I think I
    >see the way you were going and I'll experiment some more - I suspect the
    >double quotes are causing a problem.
    >
    >Wayne
    >
    >
    >"Jim Cheshire [MSFT]" <> wrote in message
    >news:hy2Cz$...
    >> Hi Wayne,
    >>
    >> The error is right. Here's how the tag should look:
    >>
    >> <asp:HyperLink id="editlink" runat="server"
    >> Text = "Edit"
    >> NavigateURL=
    >>

    >"evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption=<%#Contain

    e
    >> r.DataItem("Caption")%>
    >>
    >>
    >> Jim Cheshire, MCSE, MCSD [MSFT]
    >> ASP.NET
    >> Developer Support
    >>
    >>
    >> This post is provided "AS-IS" with no warranties and confers no rights.
    >>
    >>
    >> --------------------
    >> >From: "Wayne Wengert" <>
    >> >Subject: Trying to create a hyperlink
    >> >Date: Thu, 1 Apr 2004 09:31:31 -0700
    >> >Lines: 25
    >> >X-Priority: 3
    >> >X-MSMail-Priority: Normal
    >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >> >Message-ID: <>
    >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >> >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    >> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    >> >Xref: cpmsftngxa06.phx.gbl

    >> microsoft.public.dotnet.framework.aspnet.webcontrols:19884
    >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >> >
    >> >I am trying to create a hyperlink which calls a specific page and passes
    >> >some variables. I am getting an error message on the code section below.

    >> The
    >> >error states that "the server tag is not well formed". I suspect it is

    my
    >> >syntax? I know the data fields are OK as they display fine in the other
    >> >cells.
    >> >
    >> >
    >> >=====================================================
    >> ><td>
    >> > <asp:HyperLink id="editlink" runat="server"
    >> > Text = "Edit"
    >> > NavigateURL= "evaljudge.asp?name=" &
    >> ><%#Container.DataItem("JudgeName")%> & "&caption=" &
    >> ><%#Container.DataItem("Caption")%>
    >> > </asp:HyperLink>
    >> ></td>
    >> ><td>
    >> > <%#Container.DataItem("JudgeName")%>
    >> ></td>
    >> ><td align="center">
    >> > <%#Container.DataItem("Caption")%>
    >> ></td>
    >> >
    >> >
    >> >
    >> >

    >>

    >
    >
    >
     
    Jim Cheshire [MSFT], Apr 1, 2004
    #5
  6. Jim;

    Thanks again but that yields a URL of:


    http://localhost:8080/evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption=<%Container.DataItem("Caption")%>

    I want the values from the database substituted for the "Container.Item..."
    calls.

    Wayne

    "Jim Cheshire [MSFT]" <> wrote in message
    news:...
    > Hi Wayne,
    >
    > Sorry about that. I didn't see the double quotes. To correct that,

    simply
    > enclose the attribute in single quotes. For example:
    >
    >

    NavigateURL='evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption
    > =<%#Container.DataItem("Caption")%>'
    >
    > Jim Cheshire, MCSE, MCSD [MSFT]
    > ASP.NET
    > Developer Support
    >
    >
    > This post is provided "AS-IS" with no warranties and confers no rights.
    >
    > --------------------
    > >From: "Wayne Wengert" <>
    > >References: <>

    > <hy2Cz$>
    > >Subject: Re: Trying to create a hyperlink
    > >Date: Thu, 1 Apr 2004 12:50:45 -0700
    > >Lines: 78
    > >X-Priority: 3
    > >X-MSMail-Priority: Normal
    > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > >Message-ID: <>
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    > >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    > >Xref: cpmsftngxa06.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webcontrols:19889
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > >
    > >Jim;
    > >
    > >Thanks for the response but that still generates the same error. I think

    I
    > >see the way you were going and I'll experiment some more - I suspect the
    > >double quotes are causing a problem.
    > >
    > >Wayne
    > >
    > >
    > >"Jim Cheshire [MSFT]" <> wrote in message
    > >news:hy2Cz$...
    > >> Hi Wayne,
    > >>
    > >> The error is right. Here's how the tag should look:
    > >>
    > >> <asp:HyperLink id="editlink" runat="server"
    > >> Text = "Edit"
    > >> NavigateURL=
    > >>

    >
    >"evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption=<%#Contain
    > e
    > >> r.DataItem("Caption")%>
    > >>
    > >>
    > >> Jim Cheshire, MCSE, MCSD [MSFT]
    > >> ASP.NET
    > >> Developer Support
    > >>
    > >>
    > >> This post is provided "AS-IS" with no warranties and confers no rights.
    > >>
    > >>
    > >> --------------------
    > >> >From: "Wayne Wengert" <>
    > >> >Subject: Trying to create a hyperlink
    > >> >Date: Thu, 1 Apr 2004 09:31:31 -0700
    > >> >Lines: 25
    > >> >X-Priority: 3
    > >> >X-MSMail-Priority: Normal
    > >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > >> >Message-ID: <>
    > >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > >> >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    > >> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    > >> >Xref: cpmsftngxa06.phx.gbl
    > >> microsoft.public.dotnet.framework.aspnet.webcontrols:19884
    > >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > >> >
    > >> >I am trying to create a hyperlink which calls a specific page and

    passes
    > >> >some variables. I am getting an error message on the code section

    below.
    > >> The
    > >> >error states that "the server tag is not well formed". I suspect it is

    > my
    > >> >syntax? I know the data fields are OK as they display fine in the

    other
    > >> >cells.
    > >> >
    > >> >
    > >> >=====================================================
    > >> ><td>
    > >> > <asp:HyperLink id="editlink" runat="server"
    > >> > Text = "Edit"
    > >> > NavigateURL= "evaljudge.asp?name=" &
    > >> ><%#Container.DataItem("JudgeName")%> & "&caption=" &
    > >> ><%#Container.DataItem("Caption")%>
    > >> > </asp:HyperLink>
    > >> ></td>
    > >> ><td>
    > >> > <%#Container.DataItem("JudgeName")%>
    > >> ></td>
    > >> ><td align="center">
    > >> > <%#Container.DataItem("Caption")%>
    > >> ></td>
    > >> >
    > >> >
    > >> >
    > >> >
    > >>

    > >
    > >
    > >

    >
     
    Wayne Wengert, Apr 1, 2004
    #6
  7. Found something that works.

    After google'ing I found the following syntax that seems to work,

    <td>
    <asp:HyperLink id="XX" runat="server"
    NavigateUrl = '<%# "http://wengert.org/evaljudge.asp?name=" +
    DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption=" +
    DataBinder.Eval(Container.DataItem,"Caption")%>'
    Text = "Edit" >
    </asp:HyperLink>
    </td>

    I gather you must use the "DataBinder" syntax in this case - Not sure why.
    Time for more reading!

    Wayne

    "Wayne Wengert" <> wrote in message
    news:...
    > I am trying to create a hyperlink which calls a specific page and passes
    > some variables. I am getting an error message on the code section below.

    The
    > error states that "the server tag is not well formed". I suspect it is my
    > syntax? I know the data fields are OK as they display fine in the other
    > cells.
    >
    >
    > =====================================================
    > <td>
    > <asp:HyperLink id="editlink" runat="server"
    > Text = "Edit"
    > NavigateURL= "evaljudge.asp?name=" &
    > <%#Container.DataItem("JudgeName")%> & "&caption=" &
    > <%#Container.DataItem("Caption")%>
    > </asp:HyperLink>
    > </td>
    > <td>
    > <%#Container.DataItem("JudgeName")%>
    > </td>
    > <td align="center">
    > <%#Container.DataItem("Caption")%>
    > </td>
    >
    >
    >
     
    Wayne Wengert, Apr 2, 2004
    #7
  8. Wayne,

    I'm not very sure about what you're doing in the absence of the rest of
    your application, but there is no DataItem property of the Container
    object. If what you are trying to do is bind this property to some
    datasource from code-behind, you would typically use DataBinder.Eval and
    pass to it the Container and the DataItem that you want to bind.

    You can see an example of this by opening the HTML view of any ASPX page
    created in VS.NET that contains a data-bound value.

    Hope that helps.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: "Wayne Wengert" <>
    >References: <>

    <hy2Cz$>
    <>
    <>
    >Subject: Re: Trying to create a hyperlink
    >Date: Thu, 1 Apr 2004 15:43:41 -0700
    >Lines: 140
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:19895
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >
    >Jim;
    >
    >Thanks again but that yields a URL of:
    >
    >
    >http://localhost:8080/evaljudge.asp?name=<%#Container.DataItem("JudgeName")

    %>&caption=<%Container.DataItem("Caption")%>
    >
    >I want the values from the database substituted for the "Container.Item..."
    >calls.
    >
    >Wayne
    >
    >"Jim Cheshire [MSFT]" <> wrote in message
    >news:...
    >> Hi Wayne,
    >>
    >> Sorry about that. I didn't see the double quotes. To correct that,

    >simply
    >> enclose the attribute in single quotes. For example:
    >>
    >>

    >NavigateURL='evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&captio

    n
    >> =<%#Container.DataItem("Caption")%>'
    >>
    >> Jim Cheshire, MCSE, MCSD [MSFT]
    >> ASP.NET
    >> Developer Support
    >>
    >>
    >> This post is provided "AS-IS" with no warranties and confers no rights.
    >>
    >> --------------------
    >> >From: "Wayne Wengert" <>
    >> >References: <>

    >> <hy2Cz$>
    >> >Subject: Re: Trying to create a hyperlink
    >> >Date: Thu, 1 Apr 2004 12:50:45 -0700
    >> >Lines: 78
    >> >X-Priority: 3
    >> >X-MSMail-Priority: Normal
    >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >> >Message-ID: <>
    >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >> >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    >> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    >> >Xref: cpmsftngxa06.phx.gbl

    >> microsoft.public.dotnet.framework.aspnet.webcontrols:19889
    >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >> >
    >> >Jim;
    >> >
    >> >Thanks for the response but that still generates the same error. I think

    >I
    >> >see the way you were going and I'll experiment some more - I suspect the
    >> >double quotes are causing a problem.
    >> >
    >> >Wayne
    >> >
    >> >
    >> >"Jim Cheshire [MSFT]" <> wrote in message
    >> >news:hy2Cz$...
    >> >> Hi Wayne,
    >> >>
    >> >> The error is right. Here's how the tag should look:
    >> >>
    >> >> <asp:HyperLink id="editlink" runat="server"
    >> >> Text = "Edit"
    >> >> NavigateURL=
    >> >>

    >>
    >>"evaljudge.asp?name=<%#Container.DataItem("JudgeName")%>&caption=<%#Contai

    n
    >> e
    >> >> r.DataItem("Caption")%>
    >> >>
    >> >>
    >> >> Jim Cheshire, MCSE, MCSD [MSFT]
    >> >> ASP.NET
    >> >> Developer Support
    >> >>
    >> >>
    >> >> This post is provided "AS-IS" with no warranties and confers no

    rights.
    >> >>
    >> >>
    >> >> --------------------
    >> >> >From: "Wayne Wengert" <>
    >> >> >Subject: Trying to create a hyperlink
    >> >> >Date: Thu, 1 Apr 2004 09:31:31 -0700
    >> >> >Lines: 25
    >> >> >X-Priority: 3
    >> >> >X-MSMail-Priority: Normal
    >> >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >> >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >> >> >Message-ID: <>
    >> >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >> >> >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    >> >> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
    >> >> >Xref: cpmsftngxa06.phx.gbl
    >> >> microsoft.public.dotnet.framework.aspnet.webcontrols:19884
    >> >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >> >> >
    >> >> >I am trying to create a hyperlink which calls a specific page and

    >passes
    >> >> >some variables. I am getting an error message on the code section

    >below.
    >> >> The
    >> >> >error states that "the server tag is not well formed". I suspect it

    is
    >> my
    >> >> >syntax? I know the data fields are OK as they display fine in the

    >other
    >> >> >cells.
    >> >> >
    >> >> >
    >> >> >=====================================================
    >> >> ><td>
    >> >> > <asp:HyperLink id="editlink" runat="server"
    >> >> > Text = "Edit"
    >> >> > NavigateURL= "evaljudge.asp?name=" &
    >> >> ><%#Container.DataItem("JudgeName")%> & "&caption=" &
    >> >> ><%#Container.DataItem("Caption")%>
    >> >> > </asp:HyperLink>
    >> >> ></td>
    >> >> ><td>
    >> >> > <%#Container.DataItem("JudgeName")%>
    >> >> ></td>
    >> >> ><td align="center">
    >> >> > <%#Container.DataItem("Caption")%>
    >> >> ></td>
    >> >> >
    >> >> >
    >> >> >
    >> >> >
    >> >>
    >> >
    >> >
    >> >

    >>

    >
    >
    >
     
    Jim Cheshire [MSFT], Apr 2, 2004
    #8
  9. Hi Wayne,

    Cool. Glad you found this. I actually just replied to your previous post
    but didn't see this in our tool until after posting.

    You might get better info on why this is the case from someone in the group
    who deals with databinding on a regular basis. My team doesn't typically
    deal with databinding code (we have a specific team for those kinds of
    issues), but the syntax you have in this post is correct.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: "Wayne Wengert" <>
    >References: <>
    >Subject: Re: Trying to create a hyperlink
    >Date: Thu, 1 Apr 2004 18:32:40 -0700
    >Lines: 48
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:19898
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >Found something that works.
    >
    >After google'ing I found the following syntax that seems to work,
    >
    > <td>
    > <asp:HyperLink id="XX" runat="server"
    > NavigateUrl = '<%# "http://wengert.org/evaljudge.asp?name="

    +
    >DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption=" +
    >DataBinder.Eval(Container.DataItem,"Caption")%>'
    > Text = "Edit" >
    > </asp:HyperLink>
    ></td>
    >
    >I gather you must use the "DataBinder" syntax in this case - Not sure why.
    >Time for more reading!
    >
    >Wayne
    >
    >"Wayne Wengert" <> wrote in message
    >news:...
    >> I am trying to create a hyperlink which calls a specific page and passes
    >> some variables. I am getting an error message on the code section below.

    >The
    >> error states that "the server tag is not well formed". I suspect it is my
    >> syntax? I know the data fields are OK as they display fine in the other
    >> cells.
    >>
    >>
    >> =====================================================
    >> <td>
    >> <asp:HyperLink id="editlink" runat="server"
    >> Text = "Edit"
    >> NavigateURL= "evaljudge.asp?name=" &
    >> <%#Container.DataItem("JudgeName")%> & "&caption=" &
    >> <%#Container.DataItem("Caption")%>
    >> </asp:HyperLink>
    >> </td>
    >> <td>
    >> <%#Container.DataItem("JudgeName")%>
    >> </td>
    >> <td align="center">
    >> <%#Container.DataItem("Caption")%>
    >> </td>
    >>
    >>
    >>

    >
    >
    >
     
    Jim Cheshire [MSFT], Apr 2, 2004
    #9
  10. I appreciate all your help

    Wayne

    "Jim Cheshire [MSFT]" <> wrote in message
    news:...
    > Hi Wayne,
    >
    > Cool. Glad you found this. I actually just replied to your previous post
    > but didn't see this in our tool until after posting.
    >
    > You might get better info on why this is the case from someone in the

    group
    > who deals with databinding on a regular basis. My team doesn't typically
    > deal with databinding code (we have a specific team for those kinds of
    > issues), but the syntax you have in this post is correct.
    >
    > Jim Cheshire, MCSE, MCSD [MSFT]
    > ASP.NET
    > Developer Support
    >
    >
    > This post is provided "AS-IS" with no warranties and confers no rights.
    >
    > --------------------
    > >From: "Wayne Wengert" <>
    > >References: <>
    > >Subject: Re: Trying to create a hyperlink
    > >Date: Thu, 1 Apr 2004 18:32:40 -0700
    > >Lines: 48
    > >X-Priority: 3
    > >X-MSMail-Priority: Normal
    > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > >Message-ID: <>
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    > >NNTP-Posting-Host: c-24-8-108-168.client.comcast.net 24.8.108.168
    > >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
    > >Xref: cpmsftngxa06.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webcontrols:19898
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    > >
    > >Found something that works.
    > >
    > >After google'ing I found the following syntax that seems to work,
    > >
    > > <td>
    > > <asp:HyperLink id="XX" runat="server"
    > > NavigateUrl = '<%#

    "http://wengert.org/evaljudge.asp?name="
    > +
    > >DataBinder.Eval(Container.DataItem,"JudgeName") + "&caption=" +
    > >DataBinder.Eval(Container.DataItem,"Caption")%>'
    > > Text = "Edit" >
    > > </asp:HyperLink>
    > ></td>
    > >
    > >I gather you must use the "DataBinder" syntax in this case - Not sure

    why.
    > >Time for more reading!
    > >
    > >Wayne
    > >
    > >"Wayne Wengert" <> wrote in message
    > >news:...
    > >> I am trying to create a hyperlink which calls a specific page and

    passes
    > >> some variables. I am getting an error message on the code section

    below.
    > >The
    > >> error states that "the server tag is not well formed". I suspect it is

    my
    > >> syntax? I know the data fields are OK as they display fine in the other
    > >> cells.
    > >>
    > >>
    > >> =====================================================
    > >> <td>
    > >> <asp:HyperLink id="editlink" runat="server"
    > >> Text = "Edit"
    > >> NavigateURL= "evaljudge.asp?name=" &
    > >> <%#Container.DataItem("JudgeName")%> & "&caption=" &
    > >> <%#Container.DataItem("Caption")%>
    > >> </asp:HyperLink>
    > >> </td>
    > >> <td>
    > >> <%#Container.DataItem("JudgeName")%>
    > >> </td>
    > >> <td align="center">
    > >> <%#Container.DataItem("Caption")%>
    > >> </td>
    > >>
    > >>
    > >>

    > >
    > >
    > >

    >
     
    Wayne Wengert, Apr 2, 2004
    #10
    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. Axel Dahmen

    Can't create fragment/JavaScript hyperlink

    Axel Dahmen, Feb 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    497
    Yunus Emre ALPĂ–ZEN
    Feb 4, 2005
  2. davetichenor
    Replies:
    1
    Views:
    915
    Eliyahu Goldin
    Oct 30, 2006
  3. Replies:
    7
    Views:
    343
    Beauregard T. Shagnasty
    Sep 13, 2007
  4. Ken
    Replies:
    1
    Views:
    434
    Alvin Bruney
    Aug 16, 2003
  5. Dave
    Replies:
    0
    Views:
    1,003
Loading...

Share This Page