用Gridview每行怎样显示多张图片

来源:百度知道 编辑:UC知道 时间:2024/06/24 09:38:02
图片数量不定,用户提交几张到数据库,就在Gridview每行的最后列显示几张图片,请用C#/.NET编写

//*****用模板列,后台处理函数,下面这个函数一行显示两张图片,你跟据你需要进行相应修改就可以了.
public string DispalyImageCoun(string ImagePath)
{
StringBuilder strApp = new StringBuilder();

//*****获取数据集
DataSet DSet = new DataSet();

DSet = (new WebServices.WebFrinedServices()).FrinedUserFilter();

int i = 0;

//****设置table css样式
strApp.Append("<table class=\"tablepicturestyle\">");
foreach (DataRow dRow in DSet.Tables[0].Rows)
{
i++;

if (i % 2 == 1)
{
strApp.Append("<tr><