Convert TableCell text to hyperlink

I am extracting data from sql query to asp table in cs code page by page

TableCell tCell1 = new TableCell(); tCell1.Text = myDataRow["tid"].ToString(); 

I want to convert this id to a hyperlink. How can i do this?

+4
source share
1 answer

You can create a HyperLink control and add it as a child of the TableCell :

 HyperLink link = new HyperLink(); link.NavigateUrl = ... link.Text = ... TableCell tCell1 = new TableCell(); tCell1.Controls.Add(link); 
+8
source

Source: https://habr.com/ru/post/1382114/


All Articles