>Paul,
>
>Thank you very much for your professional advise. How about doing this in a Page_Load event of the Master Page since all my pages are using Master Page? Does that sound like a good place for the validation?
>
Page_Load may not happen early enough for all of your code. If you use these variables in a lot of places, you might want to just create a property on your baseclass of your code-behind (assuming you have a baseclass and aren't just using the default class), ex.:
Public Partial Class MyWebPage
Inherits System.Web.UI.Page
Public Partial Class MyWebPage
Inherits MyNamespace.Web.MyBasePage
That's actually what do for a few session-bound values I use in my apps.
If you don't have a base page (and don't want to retrofit it, although it's pretty easy to do a search/replace for this kind of thing) I'd suggest putting it in the Page_Init of the master page. However, accessing a property on the master page isn't seemless since you'd need to cast the master page to your actual master page type before you'd be able to access the property.