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 8312427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:09:39+00:00 2026-06-08T20:09:39+00:00

First off: I am aware that there have been some vaguely similar requests on

  • 0

First off: I am aware that there have been some vaguely similar requests on here already, but none give a complete solution to my problem, and I’m at my wit’s end trying to piece together a solution.

Anyway, so I am writing a web interface to get some info from a RESTful API. I am generating a datatable, which I display via a gridview like this:

DataTable table = new DataTable();
table.Columns.Add("entry name");
table.Columns.Add("col1");
table.Columns.Add("col2");
table.Columns.Add("etc");

foreach(string name in GetNames())
{
    DataRow row = table.NewRow();
    row["name"] = name;
    row["col1"] = SomeMethod(name);
    row["col2"] = SomeOtherMethod(name);
    row["etc"] = YouGetTheIdea(name);
    table.Rows.Add(row);
}

GridView1.DataSource = table;
GridView1.DataBind();

So far so fine. What I would really like is for the “name” column to be hyperlinks, such that either they call a method with the name as a parameter; or link to a website, with the name as part of the URL, i.e. like this:

"<a href:'www.example.com/" + name + ".csv'>" + name + "</a>"

I can’t for the life of me figure out how to do these things as dynamically as I would like. Your help would be much appreciated. Thanks.

  • 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-08T20:09:40+00:00Added an answer on June 8, 2026 at 8:09 pm

    One solution is to have your column value be the URL and then for a bound column, set the HtmlEncode = false. This would mean, in your foreach you’d do something like row['link'] = "<a href='..'>..</a>". When this is bound, it should output as HTML.

    Alternatively, you can hook into the OnRowDataBound event on the gridview and manipulate the value in your code behind.

    Or, finally, you can create an ItemTemplate column that binds appropriately:

    <asp:TemplateField HeaderText="Seniority">
        <ItemTemplate>
            <a href='example.com/<%# Eval("name")) %>'><%# Eval("name")) %></a>
        </ItemTemplate>
    </asp:TemplateField>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, I'm aware that there are many questions related to this, but none
First off, I'm aware this is a bad practice and I have answered many
first off I'm a noob to PHP but here is my problem. I am
First off, I know I can copy "this" on instantiation, but that doesn't work
First off, I'm fairly new to MVC but have an existing project in MVC3
First, let me state right off that I'm well aware that cursors are generally
I am aware that questions about recurring events are common but I have not
First off, let me explain that I am well aware of what this exception
First off, I would like to make clear, that I am SUPER NEW TO
First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP. I'm

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.