Hi,
I am trying to create a link in a gridview. The data comes from one table and the link comes from another table.
<%@ Page Language="
VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
Style="z-index: 100; left: 95px; position: absolute; top: 203px" Width="295px">
<Columns>
<asp:BoundField DataField="Tipster" HeaderText="Tipster" SortExpression="Tipster" />
<asp:BoundField DataField="Sport" HeaderText="Sport" SortExpression="Sport" />
<asp:BoundField DataField="Pick" HeaderText="Pick" SortExpression="Pick" />
<asp:BoundField DataField="Odds" HeaderText="Odds" SortExpression="Odds" />
<asp:BoundField DataField="Wager" HeaderText="Wager" SortExpression="Wager" />
<asp:BoundField DataField="Bookmaker" HeaderText="Bookmaker" SortExpression="Bookmaker" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>"
ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString.Provide rName %>"
SelectCommand="SELECT b.Tipster, b.Sport, b.Pick, b.Odds, b.Wager, '<a href='''+w.webbookie+''' target=''_blank''>'+w.Bookiename+'</a>' as Bookmaker FROM Bet as b, Website as w WHERE b.Bookmaker = w.BookieName">
</asp:SqlDataSource>
<a href="http://www.bbc.co.uk">William Hill</a>
</div>
</form>
</body>
</html>
However this does not work.
The link appears like this:
<a href='http://www.willhill.co.uk' target='_blank'>William Hill</a>
So the data is coming from the tables, but i just wanted to see William Hill and it to link to the website.
I have looked around to try to find a solution, but i am struggling.
Is there another way to do this in Asp.net's controls, or have i done something stupid in the code.
Many Thanks,
Oliver