Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I need to maintain session in one aspx page. But the master page of this page and master page of entire site is different. So how manage session in this scenario, if user make some server side activity in that page or even in any page of entire application then session alert timeout should be reset.

And before two minutes of session timeout, alert occurs and ask to user for continue or not. If user choose continue then session time should be restart.

Thanks.
Posted

1 solution

Either have both of your master pages inherit the same base page class which handles the session (OOP) or copy session handling code in both (bad practice)

The fact that the page has different master makes no difference to the session.
 
Share this answer
 
Comments
Jack_1991 6-Oct-14 5:06am    
thanks for your reply, but is there any idea to achieve this?
Sinisa Hajnal 6-Oct-14 6:12am    
Sure. Take the code that handles your session time outs. Put it in a page where that is the only code. Type of the page should be MasterPage

BaseMasterPage inherits MasterPage
Then change oth our master pages to inherit BaseMasterPage instead of MasterPage and you'll have session handling code in both while each keeps its own functionality and design.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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