用javascript绑定数据 [英] binding data with javascript

查看:82
本文介绍了用javascript绑定数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个

<script type="text/javascript">  setState(this);</script>


.net页面的源代码中的下拉列表和下拉列表


and dropdownlist in source code of .net page

<asp:DropDownList  ID="ddlState" runat="server" CssClass="input2" style="width:196px" onchange="set_city_state(this,district)">
	 <asp:ListItem Value="" Selected="True">Select State</asp:ListItem>
	 
          </asp:DropDownList>



但是我不知道如何将两者关联,以便下拉列表与用javascript编写的数据绑定..



but i don''t know how to relate both so that drop down bind with data written in javascript..

推荐答案

在on change事件中编写的函数名称必须等于用Java脚本编写的函数,以便在事件触发时将转到用Java脚本文件编写的函数.

The function name written in the on change event must be equal to the function written in the java script so that when the event fire it will go to that function written in the java script file.

<asp:dropdownlist id="ddlState" runat="server" cssclass="input2" style="width:196px" onchange="setState(this,district)" xmlns:asp="#unknown">
	 <asp:listitem value="" selected="True">Select State</asp:listitem>
	 
          </asp:dropdownlist>


这篇关于用javascript绑定数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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