N
Namshub
I have created a coposite control, consisting of text, labels , radiobuttons
and checkboxes the purpose is to create a generic control to manage user
accounts both as an admin and as a user. I have a property that tells me
wether they are adding a new user or modifying a current one.
a snippet is bellow:
Public Class UserAccount
Inherits UserControl
....
Private _DataMode As DataModeType
....
Public Property DataMode() As DataModeType
Get
Return _DataMode
End Get
Set(ByVal Value As DataModeType)
_DataMode = Value
End Set
End Property
Firstly how do i reference the user control on the form, once i've dragged
it onto the page?
I added manually the following is this correct?
Protected WithEvents useraccount1 As CWT2005.UserAccount
Now this does give me access to the comoponents, properties and methods, as
i've managed to set the property (via running the debugger), but when i call
the save method. (using a new button, sets the visiblity to true, and sets
the property to "New" (datamodetype))
UserAccount1.SaveValues()
and check the useraccount.datamode its defaulted back to "Edit"
(DatamodeType)
Can someone tell me what i'm doing wrong? The Useraccount1 control has
enabledviewstate = true. But do i have to include within the property code
adding and reading from viewstate? As i thought all properties would do
this automatically.
Thanks.
and checkboxes the purpose is to create a generic control to manage user
accounts both as an admin and as a user. I have a property that tells me
wether they are adding a new user or modifying a current one.
a snippet is bellow:
Public Class UserAccount
Inherits UserControl
....
Private _DataMode As DataModeType
....
Public Property DataMode() As DataModeType
Get
Return _DataMode
End Get
Set(ByVal Value As DataModeType)
_DataMode = Value
End Set
End Property
Firstly how do i reference the user control on the form, once i've dragged
it onto the page?
I added manually the following is this correct?
Protected WithEvents useraccount1 As CWT2005.UserAccount
Now this does give me access to the comoponents, properties and methods, as
i've managed to set the property (via running the debugger), but when i call
the save method. (using a new button, sets the visiblity to true, and sets
the property to "New" (datamodetype))
UserAccount1.SaveValues()
and check the useraccount.datamode its defaulted back to "Edit"
(DatamodeType)
Can someone tell me what i'm doing wrong? The Useraccount1 control has
enabledviewstate = true. But do i have to include within the property code
adding and reading from viewstate? As i thought all properties would do
this automatically.
Thanks.