且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.NET中的Updatepanel(Ajax)

更新时间:2023-01-06 21:51:29

首先使用脚本管理器,如



&lt ;脚本管理器>

< /脚本管理器>



然后使用更新面板,在更新面板中使用内容模板,如



<更新面板>

<内容模板>



//放置文字盒子和其他控件在这里



< / 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. Set EnablePartialRendering="true" in your ScriptManager.

3. You don't need to define any 'Trigger' in Update Panel for what you are trying right now.