ASP.NET中的Updatepanel(Ajax) [英] Updatepanel in ASP.NET (Ajax)
本文介绍了ASP.NET中的Updatepanel(Ajax)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用了updatepanel并在其中放置了两个控件,一个文本框和一个按钮,并分配了所有必需的属性。但是当我的触发器触发时,页面仍会重新加载。 PLZ帮助我如何在不重新加载页面的情况下完成任务。只需在按钮单击时在文本框中显示文本。
I have used updatepanel and placed two controls a textbox and a button in it and assigned all necessary properties. But when my trigger fires the page still reloads. plz help me how could I achieve the task without reloading page. just to display text in textbox on button click.
推荐答案
首先使用脚本管理器,如
< ;脚本管理器>
< /脚本管理器>
然后使用更新面板,在更新面板中使用内容模板,如
<更新面板>
<内容模板>
//放置文字盒子和其他控件在这里
< / content template>
< / update panel>
如果你得到你的答案,请不要忘记评价/投票给我......
谢谢
dx-army
first use the script manager like
<script manager>
</script manager>
then use update panel and in update panel use content template like
<update panel>
<content template>
//put text box and other control here
</content template>
</update panel>
If you get your answer then please don not forget to rate/vote me...
thanks
dx-army
我认为'DX Roster'所说的是正确的。如果它正在工作那么它很好。但是你的页面仍在刷新,我认为在创建项目时你没有使用过AJAX Enabled Website。在创建新项目时选择AJAX Enabled Website。试试这个......
I think whatever 'DX Roster' told is correct. If it is working then it is fine. But still your page is getting refreshed, I think you have not used "AJAX Enabled Website" while creating your project. Select "AJAX Enabled Website" while creating new project. Just try this once...
1。如果您的网站之前没有启用Ajax,那么您仍然可以通过在web.config文件中添加必要的配置来转换为一个。最简单的方法是创建一个虚拟的支持Ajax的网站,并将此网站中缺失的标签复制到您希望启用Ajax的旧网站上。
2.设置您的ScriptManager中的EnablePartialRendering =true
。
3.您无需在更新面板中定义任何触发器,即可立即尝试。
1. If your website was not Ajax Enabled earlier, then you can still convert into one by adding necessary configurations in your web.config file. Easiest way would be to create a dummy 'Ajax enabled website' and copy the missing tags from this website into old one that you want as Ajax enabled.
2. SetEnablePartialRendering="true"
in your ScriptManager.
3. You don't need to define any 'Trigger' in Update Panel for what you are trying right now.
这篇关于ASP.NET中的Updatepanel(Ajax)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文