Hi all,
I am very new to ASP.Net and have been working on a particularly frustrating problem now for days and cant seem to find an answer to it. I am building a front end to a newly created database and have set 2 session variables that I am using to set default values using the FindControl Method. this works fine until I need to set default values in a nested control. IE...I have a form view control and in that controls EmptyDataTemplate I have another form view control with about 10 fields using the same datasource as the parent form view. I need to place default values in 2 of those fields..the problem is how do I reference the two fields using the findControl method? Normally I have been using the following code to reference the parent and its textboxes.
Dim Jobno As TextBox = FormView1.FindControl("AA")
and then use the following to test that the textbox is empty and populate the field.
If Jobno.Text = String.Empty Then
Jobno.Text = Session("Jobnum")
ELSE : ""
End If
Any Assistance would be greatly appreciated.
Thanks in advance.
I am very new to ASP.Net and have been working on a particularly frustrating problem now for days and cant seem to find an answer to it. I am building a front end to a newly created database and have set 2 session variables that I am using to set default values using the FindControl Method. this works fine until I need to set default values in a nested control. IE...I have a form view control and in that controls EmptyDataTemplate I have another form view control with about 10 fields using the same datasource as the parent form view. I need to place default values in 2 of those fields..the problem is how do I reference the two fields using the findControl method? Normally I have been using the following code to reference the parent and its textboxes.
Dim Jobno As TextBox = FormView1.FindControl("AA")
and then use the following to test that the textbox is empty and populate the field.
If Jobno.Text = String.Empty Then
Jobno.Text = Session("Jobnum")
ELSE : ""
End If
Any Assistance would be greatly appreciated.
Thanks in advance.