ScriptManager调用webService问题
建了一个WebService
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Services;using System.Web.Script.Services;using System.Web.Services.Protocols;using System.Collections;namespace WebService1{ /// <summary> /// Service1 的摘要说明 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ScriptService] // [System.ComponentModel.ToolboxItem(false)] // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 // [System.Web.Script.Services.ScriptService] public class Service1 : System.Web.Services.WebService { public Service1() { } [WebMethod] public string Welcome(string u) { string userName = ""; if (u == "") { userName = "游客"; } else { userName = u; } string strMsg = "欢迎[" + userName + "]访问网页"; return strMsg; } }}