从指定文件夹中读取图片文件,然后调用picture.aspx缩小后加入到(datatable对象dtbpix)中,
最后(datalist对象reppix)邦定数据源(dtbpix)显示图片。
我想让datalist控件以(4*4)的形式来显示图片,我试过很多办法但是都不行,我不知道是修改(datalist)还是修改(datatable)启求您一定帮我。(我就是想能让datalist分页最好希望您能在我的代码的基础上直接改。)
我为了这个忙了好几天了。可是还没有解决。
我是一个asp.net 的狂热爱好者可是技术还不成熟,也没有工作,更没有钱。但是我对以后有一个美好的憧憬,一条网络程序员的路。谢谢各位哥哥。
for each fnfcur in dnfcur.getfiles("*.*")
strext = lcase(fnfcur.extension)
if left(strext,1) = "." then
strext = mid(strext, 2)
end if if(strext ="gif")
or(strext ="jpg")
or(strext ="jpeg")
or(strext ="bmp") then
rowpix = dtbpix.newrow()
rowpix("filelocn") =strpath & fnfcur.name
rowpix("filethum") = "picture.aspx?" & _
"size=100&url=" & strpath & fnfcur.name
dtbpix.rows.add(rowpix)
end if
next
reppix.datasource=(dtbpix)
reppix.databind()
<asp:datalist id="reppix" runat="server">
<headertemplate>
<table border="0" align="center">
</headertemplate>
<itemtemplate>
<tr>
<td><a target="main" href="showpic.aspx?pic=<%#container.dataitem("filelocn") %>">
<imgsrc="<%# container.dataitem("filethum") %></a>
</td>
</tr>
</itemtemplate>
<footertemplate>
</table>
</footertemplate>
</asp:datalest>
最后(datalist对象reppix)邦定数据源(dtbpix)显示图片。
我想让datalist控件以(4*4)的形式来显示图片,我试过很多办法但是都不行,我不知道是修改(datalist)还是修改(datatable)启求您一定帮我。(我就是想能让datalist分页最好希望您能在我的代码的基础上直接改。)
我为了这个忙了好几天了。可是还没有解决。
我是一个asp.net 的狂热爱好者可是技术还不成熟,也没有工作,更没有钱。但是我对以后有一个美好的憧憬,一条网络程序员的路。谢谢各位哥哥。
for each fnfcur in dnfcur.getfiles("*.*")
strext = lcase(fnfcur.extension)
if left(strext,1) = "." then
strext = mid(strext, 2)
end if if(strext ="gif")
or(strext ="jpg")
or(strext ="jpeg")
or(strext ="bmp") then
rowpix = dtbpix.newrow()
rowpix("filelocn") =strpath & fnfcur.name
rowpix("filethum") = "picture.aspx?" & _
"size=100&url=" & strpath & fnfcur.name
dtbpix.rows.add(rowpix)
end if
next
reppix.datasource=(dtbpix)
reppix.databind()
<asp:datalist id="reppix" runat="server">
<headertemplate>
<table border="0" align="center">
</headertemplate>
<itemtemplate>
<tr>
<td><a target="main" href="showpic.aspx?pic=<%#container.dataitem("filelocn") %>">
<imgsrc="<%# container.dataitem("filethum") %></a>
</td>
</tr>
</itemtemplate>
<footertemplate>
</table>
</footertemplate>
</asp:datalest>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货