Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8925739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:46:48+00:00 2026-06-15T07:46:48+00:00

I want to create a table format with two columns where each row will

  • 0

I want to create a table format with two columns where each row will have a ProductTitle and its corresponding URL.

I am using the following code which gives the info in table format. I displays entire anchor tag in second column.

But i want only the Text to be displayed as link in second column. On click of which it should open the URL page.

DataTable dt = new DataTable();

dt.Columns.Add("ProductTitle");
dt.Columns.Add("Link");

DataRow dr = dt.NewRow();
dr["ProductTitle"] = "GOOGLE";
dr["Link"] = "<" + "a href=\"" + "http://www.google.com" + "\">Google" + "</a>";
dt.Rows.Add(dr);

Gridview1.DataSource = dt;
Gridview1.DataBind();

Could anyone suggest.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:46:50+00:00Added an answer on June 15, 2026 at 7:46 am

    You could modify the .aspx file as follows:

        ...
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
            <Columns>
                <asp:BoundField DataField="ProductTitle" HeaderText="Product Title" />
                <asp:BoundField DataField="Link" HtmlEncode="false" HeaderText="Link" />
            </Columns>
        </asp:GridView>
        ...
    

    So, you should disable the automatic column generation by setting AutoGenerateColumns="false" and format the Columns section of the GridView. Please note the key element here for the link rendering, which is the HtmlEncode="false" attribute. You can also set everything in the code behind file:

        GridView1.AutoGenerateColumns = false;
    
        var productTitleField=new BoundField();
        productTitleField.DataField="ProductTitle";
        productTitleField.HeaderText="Product Title";
    
        var linkField=new BoundField();
        linkField.DataField="Link";
        linkField.HeaderText="Link";
        linkField.HtmlEncode=false;
    
        GridView1.Columns.Add(productTitleField);
        GridView1.Columns.Add(linkField);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a table structure with checkbox for each row and each
I want to create a table that is fully contained within its parent element,
i want to create a table : products which looks like (these are columns
I have two tables: CREATE TABLE InmarsatZenith.dbo.ClientJob (JobRef int PRIMARY KEY NOT NULL, IntRef
I have a table which has two columns (id and word). I have an
I want to create a table of friends with personal information and log on
I want to create a table like myTable = { [0] = { [a]
I want to create a table in MS SQL Server 2005 to record details
I want to create some table through PHP but it fails everytime, but the
I want to create this table in Oracle. This is only the table SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.