【发布时间】:2014-04-21 12:49:44
【问题描述】:
- 我正在尝试选择文件夹内容
- 在该文件夹中包含图像,当我选择该文件夹时,它将选择所有内容。
- 另外它正在使用 img src undefind
-
所以我需要删除,如果使用 asp.net c# 未定义 src,我该如何删除
<div id="cell" class="box2"> <a href="undefined"> <img width="260px" height="135px" src="undefined" alt="" style="box-shadow: 1px 2px 2px #BDBDBD; border: 1px solid #D1D1D1;"> </img> </a> </div>
文件隐藏代码:
protected void chbindustry_SelectedIndexChanged(object sender, EventArgs e)
{
if (result == false)
{
string[] subdirectoryEntries = Directory.GetDirectories(Server.MapPath("BusinessCards"));
string f;
string[] ss;
string side = chklist.SelectedValue;// RadioButtonList1.SelectedValue;
foreach (ListItem li in chbindustry.Items)
{
if (li.Selected)
{
ss = li.Text.Split('(');
f = Server.MapPath("BusinessCards").ToString() + "\\" + ss[0];
int c = f.Count();
DirectoryInfo d = new DirectoryInfo(f);
int len = d.GetFiles().Length;
for (int i = 1; i <= d.GetFiles().Length / 3; i++)
{
Page.ClientScript.RegisterArrayDeclaration("ImgPaths", "'" + "BusinessCards/" + f.Remove(0, f.LastIndexOf('\\') + 1) + "/" + i + ".jpg'");
Page.ClientScript.RegisterArrayDeclaration("refs", "'" + "DesignBCs.aspx?img=BusinessCards/" + f.Remove(0, f.LastIndexOf('\\') + 1) + "/" + i + "&Side=" + side + "'");
}
}
}
}
result = true;
}
【问题讨论】: