WebForm1.aspx:-
-------------------------
WebForm2.aspx.cs:-
-----------------------------
Other Example:-
------------------------
Thank You.
-------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function () {
SearchText();
});
function SearchText() {
$("#txtSearch").autocomplete({
source: function (request, response)
{
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebForm2.aspx/GetAutoCompleteData",
data: "{'username':'" +
$("#txtSearch").val() + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error");
}
});
},
select: function (event, ui) {
fillDdl(ui.item.value);
}
});
function fillDdl(value) {
$.ajax({
url: "WebForm2.aspx?name=" + value,
async: true,
data: {
},
success: function (data) {
var n = data.split(",");
for (var i = 0; i < n.length; i++) {
var newOption = $('<option value="' +
n[i] + '">' + n[i] + '</option>');
$('#ddl').append(newOption);
}
},
error: function (data) {
alert(data);
}
});
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<label for="lblSearch">Search: </label>
<input id="txtSearch" />
<select id="ddl">
<option>Select</option>
</select>
</div>
</form>
</body>
</html>
-----------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2
{
public partial class WebForm2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strName = Request.QueryString["name"];
if (strName != "" && strName != null)
{
var strResult1 = "a,b,c,d";
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write(strResult1);
HttpContext.Current.Response.End();
}
}
[WebMethod]
public static List<string> GetAutoCompleteData(string username)
{
List<string> result = new List<string>();
result.Add("one");
result.Add("two");
result.Add("three");
return result;
}
//[WebMethod]
//public
static List<string> GetAutoCompleteData(string username)
//{
// List<string> result = new
List<string>();
// using (SqlConnection con = new
SqlConnection("Data Source=SureshDasari;Integrated Security=true;Initial
Catalog=MySampleDB"))
// {
// using (SqlCommand cmd = new
SqlCommand("select DISTINCT UserName from UserInformation where UserName
LIKE '%'+@SearchText+'%'", con))
// {
// con.Open();
//
cmd.Parameters.AddWithValue("@SearchText", username);
// SqlDataReader dr =
cmd.ExecuteReader();
// while (dr.Read())
// {
//
result.Add(dr["UserName"].ToString());
// }
// return result;
// }
// }
//}
}
}
---------------------------------------------------------------------------Other Example:-
------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="WebApplication2.WebForm3" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript">
$(function () {
var x = [
{ label: 'apple', value: 'Delicious' },
{ label: 'kiwi', value: 'Yummy' },
{ label: 'kiwiooo', value: 'aaa' },
{ label: 'lemon', value: 'Sour' }
];
$("#fruit").autocomplete({
source: x,
focus: function () { return false; }
})
.on('autocompleteresponse
autocompleteselect', function (e, ui) {
var t = $(this),
details = $('#details'),
label = (e.type == 'autocompleteresponse' ?
ui.content[0].label : ui.item.label),
value = (e.type == 'autocompleteresponse' ?
ui.content[0].value : ui.item.value);
t.val(label);
details.val(value);
return false;
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id='fruit' name='fruit' type='text'>
<input id='details' name='details' type='text'>
</div>
</form>
</body>
</html>
Gümüşçay
ReplyDeletePaşaköy
Saraykent
Çarşı
DemirtaÅŸ
AEDZ
https://bayanlarsitesi.com/
ReplyDeleteEskiÅŸehir
Erzincan
Ardahan
Erzurum
WXQ
tekirdaÄŸ
ReplyDeletetokat
elazığ
adıyaman
çankırı
NPEQ
whatsapp görüntülü show
ReplyDeleteücretli.show
8OWXL
E156C
ReplyDeleteBtcturk Güvenilir mi
Çanakkale Evden Eve Nakliyat
Bartın Evden Eve Nakliyat
Balıkesir Evden Eve Nakliyat
Kocaeli Evden Eve Nakliyat
55C50
ReplyDeleteKastamonu Rastgele Sohbet Siteleri
tunceli yabancı sohbet
Kilis En İyi Görüntülü Sohbet Uygulamaları
düzce canlı görüntülü sohbet
sesli sohbet sitesi
bingöl ücretsiz görüntülü sohbet uygulamaları
antep mobil sohbet odaları
Denizli Sohbet Uygulamaları
maraş seslı sohbet sıtelerı
EBDA2
ReplyDeleteParasız Görüntülü Sohbet
Dlive Takipçi Satın Al
Soundcloud Dinlenme Hilesi
Instagram BeÄŸeni Hilesi
Coin Ãœretme
Tiktok Takipçi Satın Al
Sweat Coin Hangi Borsada
Likee App Beğeni Satın Al
Threads Beğeni Satın Al
A1F09
ReplyDeletemobil 4g proxy
bitexen
bitexen
bitexen
coin nasıl alınır
paribu
bitcoin hangi bankalarda var
toptan sabun
filtre kağıdı
F02CF
ReplyDeletebitcoin ne zaman çıktı
paribu
bkex
bitexen
kripto ne demek
poloniex
telegram türk kripto kanalları
en güvenilir kripto borsası
kredi kartı ile kripto para alma
AE69A
ReplyDeletebitexen
kraken
bybit
paribu
mexc
bitcoin hesabı nasıl açılır
referans kimligi nedir
telegram en iyi kripto grupları
4g mobil proxy
F15E6
ReplyDeleteücretli güvenilir şov
58099
ReplyDeleteücretli sanal şov
68531
ReplyDeletewhatsapp görüntülü show
0BC02
ReplyDeletegörüntülü show
DE3D3BA7A8
ReplyDeletewhatsapp ücretli show
canli web cam show
skype ÅŸov
whatsapp görüntülü şov
canli cam show
cam show
skype show
görüntülü show
whatsapp görüntülü show güvenilir
DCF29BA0A4
ReplyDeletebufalo çikolata
maxman
bufalo içecek
lifta
cobra vega
vigrande
green temptation
sildegra
degra
A1C53AA909
ReplyDeletekaldırıcı
themra macun
viga
cam show
cialis
cobra vega
yapay kızlık zarı
ücretli show
ücretli şov
2A8F3F5E9A
ReplyDeletetwitter beÄŸeni
8D1DA2B173
ReplyDeletesteroid satın al
cialis
ÅŸov