I have the following code which creates a list with pagination enabled:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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="CustomersGridView"
datasourceid="CustomersSource"
autogeneratecolumns="true"
emptydatatext="No data available."
allowpaging="true"
runat="server">
<pagersettings mode="Numeric"
position="Bottom"
pagebuttoncount="10"/>
<pagerstyle backcolor="LightBlue"
height="30px"
verticalalign="Bottom"
horizontalalign="Left"/>
</asp:gridview>
<asp:sqldatasource id="CustomersSource"
selectcommand="select id, text from table1"
connectionstring="connection string here"
runat="server"/>
</div>
</form>
</body>
</html>
Is it possible to hide the id, and convert the text into a link while at the same time applying the id to the link?
i.e. if the first row from the database from the text column contains "document one" and the id is 1, at the moment, it will display id as 1 and text as "document one" in the gridview. how do I change that to something like <a href="http://mysite/document.aspx?id=1">document one</a>
?