In my project, all aspx files have to test on pageload whether system is on or off (by get value from a table in database). If system is on, the page will work as normal, for else redirect to system offline page.
By this way, I have to modify every pages in my project, i think it's not optimized
So, are there any way to do once for all pages from global.asax or any ways similar?
aspnetDev198...
Member
36 Points
28 Posts
Detect System Offline by Global.asax
Feb 25, 2012 02:50 AM|LINK
Hi everyone,
In my project, all aspx files have to test on pageload whether system is on or off (by get value from a table in database). If system is on, the page will work as normal, for else redirect to system offline page.
By this way, I have to modify every pages in my project, i think it's not optimized
So, are there any way to do once for all pages from global.asax or any ways similar?
I hope you will please to help me.
Thanks
Yorrick vd V...
Participant
1674 Points
301 Posts
Re: Detect System Offline by Global.asax
Feb 25, 2012 04:08 AM|LINK
Hi,
You could use:
Application_BeginRequest in global.asax. However this fires on all requests, not only on aspx but also images , java scripts and others.
Hope this helps.
Regards,
Yorrick
&
Don't forget to click "Mark As Answer" on the post that helped you.
aspnetDev198...
Member
36 Points
28 Posts
Re: Detect System Offline by Global.asax
Feb 27, 2012 10:37 AM|LINK
Thanks my friend,
I will try!
jaybiet
Member
80 Points
20 Posts
Re: Detect System Offline by Global.asax
Feb 27, 2012 10:57 AM|LINK
You can also use masterpage . In the page load event of master page you can check the system status and then accordingly you can redirect ur page.
Jay
Please mark as Answer if post helps in resolving your issue
aspnetDev198...
Member
36 Points
28 Posts
Re: Detect System Offline by Global.asax
Feb 27, 2012 04:30 PM|LINK
Well, that's a good one too.
Thanks Jaybiet.