C
Colin Robinson
Help please
I have an example class called Person with 2 public properties Firstname
and Lastname, I cant create a textbox on an asp.net form bound to the
Person.Firstname property
Can anyone help with the required syntax?
if i do TExtbox1.text = x.firstname it works ok, but I want to edit the
textbox setting the value of x.firstname.
I am after a webcontrol that will edit person class with a button that will
save person class back to the database.
Here is the page code so far :
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim x As New person
x.firstname = "fred"
Page.DataBind()
'Textbox2 has a databinding on the text property = Person.firstname
End Sub
End Class
Public Class person
Private _firstname
Public Property firstname() As String
Get
Return _firstname
End Get
Set(ByVal Value As String)
_firstname = Value
End Set
End Property
End Class
I have an example class called Person with 2 public properties Firstname
and Lastname, I cant create a textbox on an asp.net form bound to the
Person.Firstname property
Can anyone help with the required syntax?
if i do TExtbox1.text = x.firstname it works ok, but I want to edit the
textbox setting the value of x.firstname.
I am after a webcontrol that will edit person class with a button that will
save person class back to the database.
Here is the page code so far :
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim x As New person
x.firstname = "fred"
Page.DataBind()
'Textbox2 has a databinding on the text property = Person.firstname
End Sub
End Class
Public Class person
Private _firstname
Public Property firstname() As String
Get
Return _firstname
End Get
Set(ByVal Value As String)
_firstname = Value
End Set
End Property
End Class