AJAX扩展-更新面板问题 [英] AJAX Extentsion - Update Panel Problem
问题描述
我非常喜欢开发可快速响应并立即为用户提供所需内容的Web应用程序,这就是为什么我喜欢使用AJAX ControlToolkit.
但是我意识到当我在UpdatePanel控件中有执行该脚本的按钮时,我无法执行client(javascript)-script.同样,我不能使用FileUpload控件的SaveAs方法附加图片或文档,相反,单击按钮时FileUpload内容(我浏览的文件)将失去它的值.另外,当发生回发时,我使用Calender扩展器的TextBox丢失了其Date值.
有没有解决这个问题的方法?我的意思是向ASP服务器控件添加扩展程序不应阻止它们执行服务器脚本.
请帮助解决此问题.
谢谢.
Hi guy,
I so much love developing web apps that are quick responsive and give users what they want instantly, that is why I love using AJAX ControlToolkit.
But I realize that I cannot execute client(javascript)-script when I have button to execute this script inside an UpdatePanel control. Similarly, I cannot use the SaveAs method of the FileUpload control to attached a picture or document, instead, the FileUpload content (the file I browsed) will lost it value at the click of the button. Also, a TextBox that I use Calender extender for losts it''s Date value when postback occurs.
Is there a way arround solving this problem? I mean adding extenders to ASP server controls should not cease them from executing the server script.
Please help on this issue.
Thanks.
推荐答案
以下是使用AJAX时执行javascript的示例
ScriptManager.RegisterStartupScript(this,this.GetType(),"alertUser","alert(``您必须按回车才能继续'');",true);
将fileupload和textbox + calendar扩展程序放在另一个updatepanel中,以免它们丢失值.
Below is the sample to execute javascript while using AJAX
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser", "alert(''You must hit enter to continue'');", true);
Put the fileupload and textbox + calendar extender inside another updatepanel, so that they don''t loose value.
这篇关于AJAX扩展-更新面板问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!