Server ASP.NET Development Server/9.0.0.0
Date Thu, 31 Dec 2009 10:27:30 GMT
X-AspNet-Version 2.0.50727
Cache-Control private, max-age=0
Content-Type text/xml; charset=utf-8
Content-Length 359127
Connection Close
Request Headers
Host localhost:5346
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Content-Type application/x-www-form-urlencoded
Referer http://localhost:5346/WebSite4/
/***************************************************************************************/
Server ASP.NET Development Server/9.0.0.0
Date Thu, 31 Dec 2009 10:30:32 GMT
X-AspNet-Version 2.0.50727
Cache-Control private, max-age=0
Content-Type application/json; charset=utf-8
Content-Length 8818
Connection Close
X-lori-time-2 1262255432670
Request Headers
Host localhost:15943
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept application/json, text/javascript, */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Content-Type application/json; charset=utf-8
X-Requested-With XMLHttpRequest
Referer http://localhost:15943/presentationJSOn/WebUsersJSON.aspx
Content-Length 2
Cookie .DBANON=Rf1i0qjr-3L_3lr0YAie3kyDIxJ2MqPNCz3aqN-IlQHyL8GhvK8gzR2VcQxSLcaEZm1QAf9kOeXkf3_snjyopziDBy9yAZWlYGp2l5ZFVwg1; ASP.NET_SessionId=z43jgu45rewsqxyjgj51i445; .AUTHCOOKIE=EFCDFF2762B619C41028425FFA00D2B6D15ECAD39F2122D869342EC3D351623DAB4A727DE1715E438A4B607E8E481B390712D74E5F45B61F5CBF6D7D4ADEC45D
X-lori-time-1 1262255432633
/***************************************************************************************/
var xmlhttp
function showHint(str) {
if (str.length == 0) {
document.getElementById("txtHint").innerHTML = "";
return;
}
xmlhttp = GetXmlHttpObject();
if (xmlhttp == null) {
alert("Your browser does not support XMLHTTP!");
return;
}
var url = "WebService.asmx/Serialize";
url = url + "?q=" + str;
url = url + "&sid=" + Math.random();
xmlhttp.onreadystatechange = stateChanged;
xmlhttp.open("POST", url, true);
xmlhttp.setRequestHeader("Content-type", "application/json; charset=utf-8");
xmlhttp.setRequestHeader("Content-length", url.length);
xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(null);
}
function stateChanged() {
if (xmlhttp.readyState == 4) {
document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
var t = xmlhttp.responseText;
alert(t.length);
}
}
function GetXmlHttpObject() {
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject) {
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
using System.Web.Script.Serialization;
using System.Web.Services;
using System.Web.Script.Services;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
////System.Net.WebClient Client = new WebClient();
////Stream strm = Client.OpenRead("http://www.google.com");
////StreamReader sr = new StreamReader(strm);
////string line;
////do
////{
//// line = sr.ReadLine();
//// listbox1.Items.Add(line);
////}
////while (line != null);
////strm.Close();
}
[WebMethod, ScriptMethod]
public List<String> GetCustomerNamesS()
{
List<String> customerList = new List<String>();
customerList.Add("John");
customerList.Add("Jacob");
customerList.Add("Mary");
customerList.Add("Peter");
customerList.Add("Darren");
return customerList;
}
[WebMethod]
public string Serialize()
{
JavaScriptSerializer ser = new JavaScriptSerializer();
List<JavaScriptConverter> converters = new List<JavaScriptConverter>();
List<String> customerList = new List<String>();
customerList.Add("John");
customerList.Add("Jacob");
customerList.Add("Mary");
customerList.Add("Peter");
customerList.Add("Darren");
return ser.Serialize(customerList);
}
}
Author:
Aamir Hasan औथोर:
आमिर हसन أثر
أمير حسن .
7ebd2d6e-290d-4d18-a52e-f43296521c5f|0|.0
ALL
asp.net, javascript, asp.net, ajax,