如何基于组合框更改事件绑定控件值? [英] How to bind controls values based on the combo box change event?
本文介绍了如何基于组合框更改事件绑定控件值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们,
我有一个简单的问题你:
实际上我从linq查询获取数据,现在我想要根据组合框的更改事件将这些数据绑定到不同的控件?
注意:
1.我不知道有任何网格视图。
2.我正在使用linq QUERY获取数据。
先谢谢!!
解决方案
您可以使用一个页面方法,它将从数据库中获取值并以JSON格式的字符串返回。您也可以使用asmx web方法返回相同的结果。
(< span class =code-string>' #ddlName')。change( function (){
PopulatePersonDetail(
(' #ddlName')。val());
});
使用jQuery'ajax'方法调用方法获取包含实际值的JSON对象。
function PopulatePersonDetail (){
var name = ' smruti 跨度>;
Hi friends,
I have a quick question for u:
Actually I am getting data from linq query and now I want to bind this data to the different controls based on the change event of the combo box?
Note:
1. I don't have any grid view.
2. I'm using linq QUERY for getting data.
Thanks in Advance!!
解决方案
You can have a page method which will get the values from database and return in JSON formatted string. You can also use asmx web methods to return the same result.
('#ddlName').change(function () { PopulatePersonDetail(
('#ddlName').val()); });
Call the method using jQuery 'ajax' method and get the JSON object which contains the actual values.
function PopulatePersonDetail(){ var name = 'smruti';
这篇关于如何基于组合框更改事件绑定控件值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文