从下拉列表中选择时阻止页面刷新 [英] Preventing page refresh on selecting from dropdownlist

查看:76
本文介绍了从下拉列表中选择时阻止页面刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在从下拉列表中选择项目时阻止页面重新加载/页面刷新???

解决方案

放置所有控件或放置必要的控件,这将导致页面重新加载在工具箱(Ajax扩展工具栏)的UPDATEPANEL中,将scriptManger放在设计页面中,这样可以防止一次又一次地加载页面......现在你的工作已经结束了...... !!!

希望这会对你有所帮助。

 <   asp: updatepanel     id   =  UpdatePanel1    runat   =  server    xmlns:asp   = #unknown >  
< contenttemplate >
区:< asp:dropdownlist id = ddl_dist runat = server autopostback = True height = 21px width = 172px >
< / asp:dropdownlist >
Taluq:< asp:dropdownlist id = ddl_tq runat = server autopostback = True height = 24px width = 174px >
< / asp:dropdownlist >

地点:< ; asp:dropdownlist id = ddl_place runat = server autopostback = True height = 24px width = 173px >
< / asp:dropdownlist < span class =code-keyword>>

Pincode:< asp:dropdownlist id = ddl_pin runat = server enabled = False height = 25px width = 171px >
< ; / asp:dropdownlist >
< / contenttemplate >
< / asp:updatepanel >


MaintainScrollPositionOnPostback = 真

>

How to Prevent page reload/page refresh on selecting an item from dropdownlist???

解决方案

Place your all controls or place necessary controls which will cause page reload in an UPDATEPANEL from toolbox(Ajax Extension toolbar) and place a scriptManger in the design page this will prevent loading page again and again.....and your work is over now..!!!
Hope this will help you.

<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
District:<asp:dropdownlist id="ddl_dist" runat="server" autopostback="True" height="21px" width="172px">
</asp:dropdownlist>
Taluq:<asp:dropdownlist id="ddl_tq" runat="server" autopostback="True" height="24px" width="174px">
</asp:dropdownlist>                    

Place:<asp:dropdownlist id="ddl_place" runat="server" autopostback="True" height="24px" width="173px">
</asp:dropdownlist>

Pincode:<asp:dropdownlist id="ddl_pin" runat="server" enabled="False" height="25px" width="171px">
</asp:dropdownlist>
</contenttemplate>
</asp:updatepanel>


MaintainScrollPositionOnPostback="true"


>


这篇关于从下拉列表中选择时阻止页面刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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