如何避免在选择的DropDownList的页面刷新 [英] How to avoid page refresh on select of DropDownList

查看:112
本文介绍了如何避免在选择的DropDownList的页面刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作中,在选择下拉列表项从数据库中的值应该出现在各自的两个文本框的项目。
但是,沿着我按这实际上是越来越基于两个值创建的图像。现在,在选择下一个DropDownList的项目,有一个页面刷新和放置的图像自败。
如何避免我心目中的页面刷新保持从数据库中的字段必须在选择的下拉列表中的两个领域得到显示在页面上。
请帮助!
谢谢...
就我而言,存在着其中有两个半区的表,左边有文本框按钮N N到出现图像表的右侧。

I am working on a project in which on selecting a drop down list item the values from the database should appear in the respective two text boxes. But, alongside I am placing an image which is actually getting created based on the two values. Now on selecting the next dropdownlist item there is a page refresh and the placed image dissapears. How to I avoid the page refresh keeping in mind that the fields from the database must get displayed on the page in the two fields on select of drop down list. Kindly help! thanks... In my case, there exists a table in which there are two halfs, the left has text boxes n a button n to the right side of the table the image appears.

推荐答案

如果您使用的是ASP.NET的WebForms,你可以换你的只有的希望回来后内部的<一个控件href=\"http://www.asp.net/web-forms/tutorials/aspnet-ajax/understanding-asp-net-ajax-updatepanel-triggers\"相对=nofollow> 的UpdatePanel

If you are using ASP.NET WebForms, you could wrap the controls which you only wants to post back inside an UpdatePanel.

另外,删除的AutoPostBack =真正的从你的DropDownList,并使用JavaScript /的 jQuery的AJAX 来执行数据库的请求。

Alternatively, remove AutoPostBack="true" from your DropDownList, and use javascript/jQuery AJAX to perform your database request.

这篇关于如何避免在选择的DropDownList的页面刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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