开发者

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.


The easiest way is to simply emit the href directly:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜