Hi Henry,
You just need to understand how to build tables, rows, cells and other items
and add them to each other. It is like those Russian dolls where small parts
are contained inside bigger and bigger ones.
Here's some code using the brand new Visual Studio 2005 Express beta:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
void Page_Load(object sender, EventArgs e)
{
Table tbl=new Table();
TableCell cell= new TableCell();
TableRow row=new TableRow();
HyperLink hlnk=new HyperLink();
hlnk.NavigateUrl="MyPage.aspx?SomeVar1=23&AnotherV ar=9&Des=This+is+the+text+description";
hlnk.ImageUrl="http://www.gc.ca/images/canada.gif";
cell.Controls.Add(hlnk);
hlnk=new HyperLink();
hlnk.NavigateUrl =
"MyPage.aspx?SomeVar1=23&AnotherVar=9&Des=This+is+ the+text+description";
hlnk.Text="<br>Here is another description - under the image";
cell.Controls.Add(hlnk);
row.Cells.Add(cell);
tbl.Rows.Add(row);
Page.Controls.Add(tbl);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
Ken
Microsoft MVP [ASP.NET]
"Henry Johnson" <ok**@dokey.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Okay - I'm spinning my wheels on this one... can someone help me figure
out
how to programmatically populate a table cell as follows (from C#
code-behind)? I've tried using a Literal control in the TableCell, a
HyperLink control, and an Image, but I'm not getting the results I want.
Here's the source of what I'm after (retrieved by viewing the source of a
page I'm trying to emulate):
<td><a
href="MyPage.aspx?SomeVar1=23&AnotherVar=9&Des=Thi s+is+the+text+description.
+"><img border=0 alt="Pick me" src="../images/myImage.gif"/><br>Here is
another description - under the image</a><br><br></td>
Basically the ultimate result I'm after is a two-column list of icons with
a
bit of text underneath. Clicking the icon or associated text results in
going to the same destination. The table provides the layout of the
icons-with-text. Most variables (image paths, etc) get populated from a
database.
Any help would be GREATLY appreciated.