В AutoCompleteExtender как я могу получить/получить доступ к ответу на стороне клиента, чтобы перенаправить страницу? ⇐ C#
В AutoCompleteExtender как я могу получить/получить доступ к ответу на стороне клиента, чтобы перенаправить страницу?
Is there a way that AutoCompleteExtender of AjaxControlToolkit provide to access its response similar to ajax success function callback. Actually I am authenticating a call to webmethod. If a request is not authentic I am returning "500" from my webmethod, but if it is authentic request it should work verbatim.
Below is the markup of my AutoCompleteExtender
Below is the code behind
[WebMethod] public object GetWorsList(string prefixText) { List workNames = null; if (ConfigurationManager.AppSettings["Header-Name"].ToString() != HttpContext.Current.Request.UrlReferrer.Host.ToString()) { return "500"; } else { /*Success Part*/ } } I want to access the "500" value on my client side so that I can redirect to Logout.aspx page.
I tried OnClientPopulated as per link 1 and link 2, but I am getting Parser Error Message: Type 'AjaxControlToolkit.AutoCompleteExtender' does not have a public property named 'OnClientPopulated'.
Which left me no other option to ask question here.
EDIT:
The JS I tried is below:
function ResponseRedirecttoLogout(sender, args) { if (args.get_response() === "500") { window.location.href = 'logout.aspx'; } }
Источник: https://stackoverflow.com/questions/780 ... de-in-orde
Is there a way that AutoCompleteExtender of AjaxControlToolkit provide to access its response similar to ajax success function callback. Actually I am authenticating a call to webmethod. If a request is not authentic I am returning "500" from my webmethod, but if it is authentic request it should work verbatim.
Below is the markup of my AutoCompleteExtender
Below is the code behind
[WebMethod] public object GetWorsList(string prefixText) { List workNames = null; if (ConfigurationManager.AppSettings["Header-Name"].ToString() != HttpContext.Current.Request.UrlReferrer.Host.ToString()) { return "500"; } else { /*Success Part*/ } } I want to access the "500" value on my client side so that I can redirect to Logout.aspx page.
I tried OnClientPopulated as per link 1 and link 2, but I am getting Parser Error Message: Type 'AjaxControlToolkit.AutoCompleteExtender' does not have a public property named 'OnClientPopulated'.
Which left me no other option to ask question here.
EDIT:
The JS I tried is below:
function ResponseRedirecttoLogout(sender, args) { if (args.get_response() === "500") { window.location.href = 'logout.aspx'; } }
Источник: https://stackoverflow.com/questions/780 ... de-in-orde
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
WebMethod сбои с неограниченным операцией с использованием AJAX: AutoCOMPLETEEXTENDER
Anonymous » » в форуме C# - 0 Ответы
- 6 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Данные не синхронизируются в онлайн-режиме на стороне клиента... но работают на моей стороне
Anonymous » » в форуме IOS - 0 Ответы
- 112 Просмотры
-
Последнее сообщение Anonymous
-