从附件中删除特定文件
问题描述:
我已附加了多个文件要上传.对于每个附件,我都具有删除"按钮.当我单击删除"按钮时,所有附件都将被删除.
因为页面刷新.
我希望删除每个&每删除按钮单击事件的特定文件.还有其他方法...我需要一些想法...
I have attached multiple file to upload.for each & every attachment i have remove button .when I click on remove button all attached files aregetting removed.
beacause of page refresh.
I want particular file to remove of each &every remove button click event. is there any other way...I need some Idea...
答
添加HTML按钮并通过Java脚本删除所选文档
Add a HTML button and remove the selected document through java script
您的删除按钮正在回发页面,这就是您丢失最后一页状态的原因.
一种简单的解决方案是使用视图状态恢复到最后一个状态.
我认为最好的解决方案是停止回发.而是使用ajax来满足这种情况.
有关视图状态的更多详细信息,请查看kb文章,
http://msdn.microsoft.com/en-us/library/ms972976.aspx [ ^ ]
有我!
欢呼
Your delete button is doing a postback to the page and that is the reason, you lost the last page state.
One simple solution is to use view state to regain to the last state.
The best solution, I see is stop doing postback. Instead use ajax to cater this situation.
For more details of view state, check kb articles,
http://msdn.microsoft.com/en-us/library/ms972976.aspx[^]
Got me!
cheers