?? webservice.cs
字號:
?using System;
using System.Web;
using System.Collections.Generic;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
using System.Collections.Specialized;
/// <summary>
/// WebService 的摘要說明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//用以調用Web Service方法簽名
[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {
public WebService () {}
private static XmlDocument xmlDoc;
private static object objectLock = new object();
public static XmlDocument Document
{
get
{
lock (objectLock)
{
if (xmlDoc == null)
{
xmlDoc = new XmlDocument();
xmlDoc.Load(HttpContext.Current.Server.MapPath("~/App_Data/XML.xml"));
}
}
return xmlDoc;
}
}
public static string[] Hierarchy
{
get
{
return new string[] { "province", "city" };
}
}
[WebMethod]
//下拉菜單提示
//public string[] GetCompletionList(string prefixText, int count)
//{
// Random random = new Random();
// List<string> items = new List<string>(count);
// for (int i = 0; i < count; i++)
// {
// char c1 = (char)random.Next(65,90);
// char c2 = (char)random.Next(97, 122);
// char c3 = (char)random.Next(48, 57);
// char c4 = (char)random.Next(33, 43);
// items.Add(prefixText + c1 + c2 + c3 + c4);
// }
// return items.ToArray();
//}
public AjaxControlToolkit.CascadingDropDownNameValue[] GetDropDownContents(string knownCategoryValues, string category)
{
StringDictionary knownCategoryValuesDictionary = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
return AjaxControlToolkit.CascadingDropDown.QuerySimpleCascadingDropDownDocument(Document, Hierarchy, knownCategoryValuesDictionary, category);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -