В AutoCompleteExtender как я могу получить/получить доступ к ответу на стороне клиента, чтобы перенаправить страницу?C#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Anonymous
 В AutoCompleteExtender как я могу получить/получить доступ к ответу на стороне клиента, чтобы перенаправить страницу?

Сообщение Anonymous »


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
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C#»