Ajax工具包fileUpload问题 [英] Ajax toolkit fileUpload Problem

查看:76
本文介绍了Ajax工具包fileUpload问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。

我在我的网站上使用ajax工具包ajax文件上传...

i已经处理了OnUpload compelete事件以将上传的文件保存到数据库这里id代码:

  decimal  result =( decimal )SqlHelper.ExecuteScalar(SqlHelper.CreateCommand(  SavePhoto
CommandType.StoredProcedure,
new SqlParameter( @ fileName,e.FileName),
new SqlParameter( @ contentType,e.ContentType),
new SqlParameter( @ content,e.GetContents())
));

this .InfoLabel.Text = result.ToString();





i应该在结果中插入照片的id并将其显示在InfoLabel上,但它不显示,当我执行断点时,该值设置为Label的Text属性但是dosnt显示它..



谢谢。

解决方案

你应该在updatepanel中使用trigger使用fullpostback。因为fileupload不能在asynchronousmode中工作


你好RedSakura,



请从下面的链接获取文件并做一些工作在它上面使它适用于您的应用程序。



http://ge.tt/4K7JFff



谢谢,

Vamsi


我为这个myslef找到了更好的解决方案。



i创建List< photo>的静态属性每次我上传一个文件,我在会话中添加该列表的属性,我需要它,我可以循环通过该列表,,,



任何方式谢谢每一个^^

hi.
im useing ajax toolkit ajax file upload on my website...
i have handled the OnUpload compelete event to save the uploaded file to database here id the code:

decimal result = (decimal)SqlHelper.ExecuteScalar(SqlHelper.CreateCommand("SavePhoto",
      CommandType.StoredProcedure,
      new SqlParameter("@fileName", e.FileName),
      new SqlParameter("@contentType", e.ContentType),
      new SqlParameter("@content", e.GetContents())
));

this.InfoLabel.Text = result.ToString();



i should have the id of inserted photo in result and display it on InfoLabel but it doesnt show and when i do a break point the value is set to Text property of Label but it dosnt display it..

thanks.

解决方案

you should use fullpostback using trigger in updatepanel. because fileupload is not working in asynchronousmode


Hi RedSakura,

Please do get the files from the below link and do some work on it to make it work for your application.

http://ge.tt/4K7JFff

Thank you,
Vamsi


i found a better solution for this myslef.

i create a static propery of List<photo> and every time i upload a file i add properties of that list in session any time i need it i can loop through that list,,,

any way thank every one ^^


这篇关于Ajax工具包fileUpload问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆