当前位置: 移动技术网 > IT编程>开发语言>.net > Csharp:jquery.ajax-combobox

Csharp:jquery.ajax-combobox

2019年07月10日  | 移动技术网IT编程  | 我要评论

汽车168,树脂佛像,土地登记代理人

<%@ page language="c#" autoeventwireup="true" codebehind="webform3.aspx.cs" inherits="comboboxdemo.webform3" %>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>jquery.ajax-combobox</title>
<meta name="author" content="geovin du 涂聚文" />
<link rel="stylesheet" href="js/jquery.ajax-combobox.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.ajax-combobox.min.js"></script>
<script type="text/javascript">
var data;
$.getjson( "ajaxcomboxhandler.ashx", function( data ) {
/*
https://github.com/sutara79/jquery.ajax-combobox
https://plugins.jquery.com/ajax-combobox/
https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/
  var items = [];
  $.each( data, function( key, val ) {
    items.push( "<li id='" + key + "'>" + data[0].countycode + "</li>" );
  });
 
  $( "<ul/>", {
    "class": "my-new-list",
    html: items.join( "" )
  }).appendto( "body" );
  */  
   $('#foo').ajaxcombobox(
    data,
    {
      sub_info: true,
      sub_as: {
        countycode: '國際區號',
        enname: '英文名',
        position: '所在洲'
      },
      select_only: true,
      init_record: '86',
      primary_key: 'countycode',
    }
  ); 
  
  
});


 //后台或者数据源
 /*=<%=data%>
  $.get("ajaxcomboxhandler.ashx", function(str) {
            var arr = eval(str);
                //alert(arr[0].countycode);
                data = arr;
                //alert(data[0].countycode);
   });
  */
 /* 
$(function() {

  $('#foo').ajaxcombobox(
    data,
    {
      sub_info: true,
      sub_as: {
        countycode: '國際區號',
        enname: '英文名',
        position: '所在洲'
      },
      select_only: true,
      init_record: '86',
      primary_key: 'countycode',
    }
  );
});*/
</script>
</head>
<body>
<h1>js object instead of db: jquery.ajax-combobox</h1>
<form id="form1" action="" runat="server">
  <label for="foo">nation:</label><br>
<asp:textbox id="foo" cssclass="foo" runat="server"></asp:textbox>
 <asp:button id="button1" runat="server" text="button" onclick="button1_click" />
</form>
</body>
</html>

  

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网