I have a textbox which can be left blank or contain a date. If the textbox has a date I want the 2nd textbox's value to be set to the value of a session variable. I need this to happen before the update sql is performed on postback.
This is the code I have. But the textbox is coming back as nothing. Whether it has a value in it or not.
If IsPostBack Then
Dim Dev_Doc_Date As TextBox
Dev_Doc_Date = FindControl("Dev_Document_Date")
If Not Dev_Doc_Date Is Nothing Then
Dim Dev_Doc_Date_Value As String
If Not String.IsNullOrEmpty(Dev_Doc_Date.Text) Then
Dev_Doc_Date_Value = Dev_Doc_Date.Text
Else
Dev_Doc_Date_Value = String.Empty
End If
End If
End If