在c#中的表格单元格中显示图像
问题描述:
我想创建一个应用程序,其中数据可以以会话变量的形式从BlogEntry.aspx传递,例如
I want to make a application in which a data can be pass from BlogEntry.aspx in the form of session variable like
Session["Title"] = this.txtTitle.Text;
Session["Blog"] = this.txtBlog.Text;
Session["Name"] = this.txtName.Text;
Session["Changed"] = true;
Session["Image"] = this.Image1.ImageUrl;
// and redirect to another page-BlogList.aspx
// here,will maintain
//Database table from scratch
DataTable theTable = new DataTable("Comments");
ds.Tables.Add(theTable);
// add a name, time, title, and blog columns to our mock-up blog database
theTable.Columns.Add("Name", Type.GetType("System.String"));
theTable.Columns.Add("Time", Type.GetType("System.DateTime"));
theTable.Columns.Add("Title", Type.GetType("System.String"));
theTable.Columns.Add("Blog", Type.GetType("System.String"));
theTable.Columns.Add("Image", Type.GetType("System.String"));
//and then write on xml file-comment.xml like
// create a new DataRow
DataRow dr = ds.Tables["Comments"].NewRow();
// Populate the row from the text boxes filled by the user
dr[0] = Session["Name"];
dr[1] = System.DateTime.Now;
dr[2] = Session["Title"];
dr[3] = Session["Blog"];
dr[4] = Session["Image"];
//And display on table by
// add title (use a single column)//
TableRow tr = new TableRow();
tr.Cells.Add(new TableCell());
// change title color slightly
tr.Cells[0].ForeColor = Color.Navy;
tr.Cells[0].Width = 400;
// make the text title big and purple
tr.Cells[0].Text = "<font size="5" color="purple" face="Rockwell">" + dr[2].ToString() + "</font>";
this.BlogTable.Rows.Add(tr);
但不能显示一个图像由 tr.Cell [o] .text->
什么是合适的请帮助我plzzz帮助我
but Can''nt display a image by tr.Cell[o].text->
what is suitable for that please help me plzzz help me