Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting plain text in gridview to html links
    primarykey
    data
    text
    <p>I have the following code which creates a list with pagination enabled:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="true" emptydatatext="No data available." allowpaging="true" runat="server"&gt; &lt;pagersettings mode="Numeric" position="Bottom" pagebuttoncount="10"/&gt; &lt;pagerstyle backcolor="LightBlue" height="30px" verticalalign="Bottom" horizontalalign="Left"/&gt; &lt;/asp:gridview&gt; &lt;asp:sqldatasource id="CustomersSource" selectcommand="select id, text from table1" connectionstring="connection string here" runat="server"/&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>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?</p> <p>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 <code>&lt;a href="http://mysite/document.aspx?id=1"&gt;document one&lt;/a&gt;</code>?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload