public string imgs;
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Params["id"] != null)
{
Bind();
}
}
protected void Bind()
{
string s = Request.Params["id"].ToString();
switch (s)
{
case "1":
imgs = "../Images/dt/1.jpg";
break;
case "2":
imgs = "../Images/dt/2.jpg";
break;
case "3":
imgs = "../Images/dt/3.jpg";
break;
case "4":
imgs = "../Images/dt/4.jpg";
break;
case "5":
imgs = "../Images/dt/6.jpg";
break;
}
}
<table border="1" cellpadding="0" cellspacing="0" width="500" background='<%#Eval("imgs") %>'>
<tr>
<td>
asdfasf
</td>
</tr>
</table>
这里的table为什么取不到所想要的背景图片 background='<%#Eval("imgs") %>'这个是用来显示背景图片的。
有人帮忙解决一下吗?