[quoted text, click to view] On Oct 19, 6:53 pm, "Paul W Smith" <p...@NOSPAM.twelve.me.uk> wrote:
> The text below is a GridView I am trying to use to display some data from=
a
> database. I am using one templatefield of grid because I want the conten=
ts
> of the record fields to appear on three different lines.
>
> Everything works except I now want to add an image with which acts as a
> hyperlink to another page. The querystring to the new page is a field fr=
om
> the database. What I cannot get right is the syntax to build the Hyperli=
nk
> to the required page using thr NavigateUrl.
>
> Can anyone tell me if what I am trying to do is possible? Is it possible=
to
> build up a NavigateUrl using Eval("FixtureID"), something along the lines=
of
> Scoreheet.aspx?FixID=3DEval("fixtureID")
>
> <asp:GridView ID=3D"GridView1" runat=3D"server" AutoGenerateColumns=3D"Fa=
lse"
> DataSourceID=3D"AccessDataSource1">
> <Columns>
> <asp:TemplateField ShowHeader=3D"False">
> <ItemTemplate>
> <table>
> <tr>
> <td>
> Played at
> <%#HomeTeamName(Eval("Home1"),Eval("Team1"),Eval("Team2"))%>
> </td>
> <td>
> <%#Eval("MatchResultText")%>
> </td>
> <td rowspan=3D"3">
> <%#Eval("FixtureID")%>
> '=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
[quoted text, click to view] > <asp:HyperLink ID=3D"HyperLink1" runat=3D"se=
rver"
> ImageUrl=3D"~/Images/Scoresheet.GIF"
> NavigateUrl=3D"<%# "Scoresheet.aspx?FixID=3D=
" &
> Eval("FixtureID"))%>"
> </asp:HyperLink>
> '=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
[quoted text, click to view] > </td>
> </tr>
> <tr>
> <td>
> <%#
> CricketScore(Eval("Team1"),Eval("Score1"),Eval("Wkts1"),Eval("Dec"),Eval(=
"O=ADvers1"))%>
> </td>
> <td>
> <%#
> TeamGamePoints(Eval("Team1"),Eval("Points1"))%>
> </td>
> </tr>
> <tr>
> <td>
> <%#CricketScore(Eval("Team2"), Eval("Score2=
"),
> Eval("Wkts2"), False, Eval("Overs2"))%>
> </td>
> <td>
> <%#
> TeamGamePoints(Eval("Team2"),Eval("Points2"))%>
> </td>
> </tr>
> </table>
> </ItemTemplate>
> </asp:TemplateField>
> </Columns>
> <asp:GridView>
<asp:HyperLink ID=3D"HyperLink1" runat=3D"server"
ImageUrl=3D"~/Images/Scoresheet.GIF"
NavigateUrl=3D'<%# "Scoresheet.aspx?FixID=3D" & Eval("FixtureID") %>' >
</asp:HyperLink>