0

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.

1
  • string temp = "VehicleDetails.aspx?ID=" + (col1); string col1to2 = "<a href="+temp+">click here</a>"; This ended up doing it for me. Thanks for your help. Commented Apr 20, 2011 at 5:26

1 Answer 1

1

The easiest way is to simply emit the href directly:

 string col2 = "<a href='somepage.aspx?someparam=someval'>Link Text</a>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.