FineUI 官方论坛
标题:
fileupload上传图片时更新contentpanel中某div的innerhtml
[打印本页]
作者:
′訫冇所屬.
时间:
2013-11-8 10:18
标题:
fileupload上传图片时更新contentpanel中某div的innerhtml
aspx代码
<x:ContentPanel ID="pnl_title" runat="server" BodyPadding="5px" ShowBorder="true" ShowHeader="true" Title="ContentPanel" EnableAjax="false"> <div id="div_display" runat="server"> </div></x:ContentPanel>
<x:FileUpload ID="filePhoto" runat="server" Label="文件上传" >
</x:FileUpload>
<x:Button ID="btnUpload" runat="server" Text="确认上传">
</x:Button>
aspx.cs
protected void btnUpload_Click(object sender,EventArgs e) { //自动创建文件夹 AutoCreatDir(Server.MapPath(Image_upload_path)); //文件上传 if (filePhoto.HasFile) { string fileName = filePhoto.ShortFileName; fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_"); fileName = DateTime.Now.Ticks.ToString() + "_" + fileName; //Alert.Show(string.Format("{0}{1}", Image_upload_path, fileName)); //return; filePhoto.SaveAs(Server.MapPath(string.Format("{0}/{1}", Image_upload_path, fileName))); //DisplayImages();
int index = int.Parse(hid_list.Value);//要修改的索引 string[] temp = hid_div_img_select.Value.Split(Join_char);
List<string> list = new List<string>(); for (int i = 0; i < Count; i++) { if (i == index) { list.Add(fileName); } else { list.Add(temp[i]); } } hid_div_img_select.Value = string.Join(Join_char.ToString(), list.ToArray()); Alert.Show(hid_div_img_select.Value); //Alert.Show("请选择要上传的图片"); //return; } //重新绑定泛型 pnl_Title_Append(); //关闭window win_Image_Select.Popup = false; }
作者:
sanshi
时间:
2013-11-8 10:19
用空项目写个简单的例子:
http://fineui.com/bbs/forum.php?mod=viewthread&tid=2123
方便别人调试
作者:
′訫冇所屬.
时间:
2013-11-8 10:28
项目示例 需要配置到iis中
作者:
′訫冇所屬.
时间:
2013-11-8 10:31
呵呵 代码有点乱,还没有整理完
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/)
Powered by Discuz! X3.4