Hi there, quite new to all this.
I have a formview on a page with some textboxes.
The textbox I want to get the value of is bound in the EditTemplate to a datetime field, and is called tbxExpiry.
The form is called frmPersonal.
I have a button at the bottom of the form with in the OnCLick event I want to take the value of the textbox and add a year to it.
I've tried:
Dim box1 As TextBox = CType(Me.FindControl("tbxExpiry"), TextBox)
MsgBox(box1.Text)
to get the value at least, but it gives "Object reference not set to an instance of an object.", and doesnt work.
I'm struggling a fair bit.
Does anyone know the best way to go about this?
I have a formview on a page with some textboxes.
The textbox I want to get the value of is bound in the EditTemplate to a datetime field, and is called tbxExpiry.
The form is called frmPersonal.
I have a button at the bottom of the form with in the OnCLick event I want to take the value of the textbox and add a year to it.
I've tried:
Dim box1 As TextBox = CType(Me.FindControl("tbxExpiry"), TextBox)
MsgBox(box1.Text)
to get the value at least, but it gives "Object reference not set to an instance of an object.", and doesnt work.
I'm struggling a fair bit.
Does anyone know the best way to go about this?