R
Rob Meade
Hi all,
At work one of my colleagues wrote a set of classes that we use in a common
class library within our applications. Although I use this on a daily basis
I haven't actually looked at his source. Now - I'm writing something at
home which needs a bit of similar functionality and I'm not sure of how it
was done.
On my web pages' code behind I'm inheriting from my page base class - some
of my pages need to be secured via a login. At work we achieve this with a
line like this:
LoginRequired = True
The only way I can think that this is being achieve is that LoginRequired is
a property of the base class (in my case), and then, in the SET part of the
Property I would need to make a call to do something, for example:
Public Property LoginRequired As Boolean
Get
Return _loginRequired
End Get
Set(ByVal value As Boolean)
_loginRequired = value
CheckSession()
End Set
End Property
Does that seem like a good use of the Set part of a property? Normally I'd
only use a writeable property like the above but without the CheckSession()
function call for example.
Any advise would be appreciated - if you can think of any others way the
original "LoginRequired = True" call is being made I'm open to suggestions.
I could obviously check the source at work tomorrow but was hoping to get
somewhere with my project at home today.
Thanks in advance for any help.
Regards
Rob
At work one of my colleagues wrote a set of classes that we use in a common
class library within our applications. Although I use this on a daily basis
I haven't actually looked at his source. Now - I'm writing something at
home which needs a bit of similar functionality and I'm not sure of how it
was done.
On my web pages' code behind I'm inheriting from my page base class - some
of my pages need to be secured via a login. At work we achieve this with a
line like this:
LoginRequired = True
The only way I can think that this is being achieve is that LoginRequired is
a property of the base class (in my case), and then, in the SET part of the
Property I would need to make a call to do something, for example:
Public Property LoginRequired As Boolean
Get
Return _loginRequired
End Get
Set(ByVal value As Boolean)
_loginRequired = value
CheckSession()
End Set
End Property
Does that seem like a good use of the Set part of a property? Normally I'd
only use a writeable property like the above but without the CheckSession()
function call for example.
Any advise would be appreciated - if you can think of any others way the
original "LoginRequired = True" call is being made I'm open to suggestions.
I could obviously check the source at work tomorrow but was hoping to get
somewhere with my project at home today.
Thanks in advance for any help.
Regards
Rob