powered by simpleCommunicator - 2.0.59     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / response.redirect
3 сообщений из 3, страница 1 из 1
response.redirect
    #33638675
Лим
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Гуру, подскажите пожалуйста!
Есть win2003+iis 6, некое приложение ASP (не .net)
имеет место проблема, связанная с тем, что после response.redirect и response.end "падает" application - то есть завершается.
В msdn по этому поводу сказано применительно к ASP.Net:
If you use the Response.End, Response.Redirect, or Server.Transfer method, a ThreadAbortException exception occurs. You can use a try-catch statement to catch this exception.

The Response.End method ends the page execution and shifts the execution to the Application_EndRequest event in the application's event pipeline. The line of code that follows Response.End is not executed.
This problem occurs in the Response.Redirect and Server.Transfer methods because both methods call Response.End internally.

и метод решения:
For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRequest method instead of Response.End to bypass the code execution to the Application_EndRequest event.
• For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse) that passes false for the endResponse parameter to suppress the internal call to Response.End. For example:

Response.Redirect ("nextpage.aspx", false);

If you use this workaround, the code that follows Response.Redirect is executed.
• For Server.Transfer, use the Server.Execute method instead.

Но проблема в том, что все эти методы решения в старом добром ASP не работают! Подскажите, как исправить?
Спасибо.
...
Рейтинг: 0 / 0
response.redirect
    #33643873
marina milanina
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
А почему вы думаете что application завершается?
Этого не должно происходить при редиректе
Какие симптомы?
...
Рейтинг: 0 / 0
response.redirect
    #33644864
VladiCh
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Server.Transfer и Server.Execute работают и в старом ASP
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / response.redirect
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]