Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / response.redirect / 3 сообщений из 3, страница 1 из 1
31.03.2006, 20:55
    #33638675
Лим
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
response.redirect
Гуру, подскажите пожалуйста!
Есть 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
04.04.2006, 15:36
    #33643873
marina milanina
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
response.redirect
А почему вы думаете что application завершается?
Этого не должно происходить при редиректе
Какие симптомы?
...
Рейтинг: 0 / 0
04.04.2006, 23:29
    #33644864
VladiCh
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
response.redirect
Server.Transfer и Server.Execute работают и в старом ASP
...
Рейтинг: 0 / 0
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / response.redirect / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


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