Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey All,

I want to perform a task of testing the existance of connection string and some app keys in web.config on Application_Start and redirect to some specific view or Action of Controller... But i came to know that there are limitations of No Request/Response context while application is using the IIS integrated mode.


So can any body point out the best practice in this regard?
Posted

1 solution

You have some problem here...
In newer (since 7 I think) IIS you can start application (pool) without any user interaction (in older version the first request started the application), so there is a situation with no-one on the other end to receive a view/action's output...
If I understood correctly, you want to redirect user to a specific page if there are missing parameters in the configuration...It can be done only upon a specific request (like in case of login page, that shows in the middle of a simple request and redirects to the same request after login completed)...
So Application_Start is not a good point to start, but maybe Request_Begin...However I would consider also who, and when can set those configuration parameters...
 
Share this answer
 
v2
Comments
VICK 28-Dec-15 7:46am    
Thanks for your precious comments. @Kornfeld

I have chosen the way of checking missed configurations on application start and setting a boolean in Application object.. and later on Login do what i want with the help of that previously saved boolean.

:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900