kshreve
kshreve

Reputation: 330

ASP.net Adding link

I'm making a Car dealership website, and in my webpage to do an advanced search i'd like to make it possible to display some details of the car then a link to the actual page of the car. Right now i have a

StringBuilder tableBuilder = new StringBuilder(); 
if(reader.HasRows)
While (reader.Read())
{
   string col0 = reader["ID"].ToString();
   string col1 = reader["Make"].ToString();
   string col2 = "LINK..."

I'd like to replace "LINK..." with a redirect to a different page+reader["ID"].ToString();, and I can't seem to find any decent material that says how to incorporate it with this. The way that it would be nice would be so that for all the cars that match the criteria, there is a link to each details page.

Upvotes: 0

Views: 119

Answers (1)

Adam Tuliper
Adam Tuliper

Reputation: 30152

The easiest way is to simply emit the href directly:

 string col2 = "<a href='somepage.aspx?someparam=someval'>Link Text</a>

Upvotes: 1

Related Questions