程序员人生 网站导航

得到Exitjs DataView中图片文件名

栏目:jscript时间:2014-05-30 06:01:57

得到Exitjs DataView中图片文件名

1、前台 

<script type="text/javascript" language="javascript">

function aa()
{
var selNode = this.DataView1.getSelectedNodes()[0];
alert( selNode.id);
}
</script>

 2、后台 

protected void Page_Load(object sender, EventArgs e)

{

string path = Server.MapPath("images/thumbs");

string[] files = System.IO.Directory.GetFiles(path);

List<object> data = new List<object>(files.Length);

foreach (string fileName in files)

{

System.IO.FileInfo fi = new System.IO.FileInfo(fileName);

data.Add(new { name = fi.Name,

url = "images/thumbs/" + fi.Name,

size = fi.Length,

lastmod = fi.LastAccessTime });

}

this.Store1.DataSource = data;

this.Store1.DataBind();

}
------分隔线----------------------------
------分隔线----------------------------

最新技术推荐