タイトルにはすべてが記載されていますが、必要な特定のシナリオをお知らせします。System.Web.UI.Pageを拡張しないクラスからSystem.Web.HttpResponseを取得します。
アプリケーションでは、JavaScriptメソッドを呼び出してユーザーをログアウトさせたいと考えています。このメソッドは順番にWebMethodを呼び出すことです:
namespace EMSApplication.Web.WebServices {
/// <summary>
/// Holds the Webservice methods of EMSApplication
/// </summary>
[WebService(Namespace = "http://ems-app.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class EMSWebService : System.Web.Services.WebService {
[WebMethod]
public string Logout() {
if (User.Identity.IsAuthenticated) {
System.Diagnostics.Debug.WriteLine(" ==JYM00000000000000000000000000000");
FormsAuthentication.SignOut();
Response.Redirect("~/default.aspx");
}
return "";
}
}
}
どうすればこの問題を解決できますか?