ASP .NET中的AJAX用于下拉列表 [英] AJAX in ASP .net for dropdownlist

查看:66
本文介绍了ASP .NET中的AJAX用于下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在ASP.net中开发Web应用程序.
我有一个DropDownList关系和一个禁用的文本框.
我希望当用户使用AJAX控件在DropDownList中选择其他文本框时启用该文本​​框(无需刷新整个页面).
帮助我解决这个问题.
问候,
Zuber Kazi

Hi Guys,
I am developing a web application in ASP.net.
I have a relationship DropDownList and a textbox which is disable.
I want that textbox enable when user select other in DropDownList using AJAX controls(Without refreshing the whole page).
Help me on this topic.
Regards,
Zuber Kazi

推荐答案

,位于下拉列表的OnSelectedIndexChanged事件中,位于后面的代码中,您可以启用/禁用文本框.

在这些控件周围使用updatepanel并在代码中使用update()
in the OnSelectedIndexChanged event of the dropdownlist in code behind you can enable/disable your textbox.

use updatepanel around these controls and update() in code


您确定此处需要对服务器进行AJAX调用吗?仅当您需要来自服务器的某些在客户端上不可用或安全的东西时,才应调用服务器.

您可以编写一个简单的javascript函数,以根据选定的下拉列表值启用/禁用文本框.将该函数附加到下拉列表的onchange事件.
您将在此处获得一些代码帮助-使用JavaScript来处理drop-下拉列表选择 [ ^ ].

希望这会有所帮助!
Are you sure an AJAX call to the server is needed here? Call to the server should be only made when you need something from the server which is not available on the client or is secure.

You can write a simple javascript function to enable/disable your textbox based on selected dropdownlist value. Attach that function to onchange event of the dropdownlist.
You will get some code help here - Using JavaScript to handle drop-down list selections[^].

Hope this helps!


亲爱的

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/DropDown/DropDown.aspx [ ^ ]

检查

谢谢,
Jitender
Hi dear

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/DropDown/DropDown.aspx[^]

check it

Thanks,
Jitender


这篇关于ASP .NET中的AJAX用于下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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