Referencing Nested Formview inside an Empty Data Template

Joined
Oct 11, 2006
Messages
1
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top