reference form field

  • Thread starter Thread starter Horace Nunley
  • Start date Start date
H

Horace Nunley

How do I get the value of the emailtextbox in a form similar to
ctl01$FormView1$EmailTextBox?

__Page ASP.posting_post_test_aspx 0 0 0
ctl02 System.Web.UI.LiteralControl 0 0 0
ctl00 System.Web.UI.HtmlControls.HtmlHead 0 0 0
ctl01 System.Web.UI.HtmlControls.HtmlTitle 0 0 0
ctl03 System.Web.UI.LiteralControl 0 0 0
form1 System.Web.UI.HtmlControls.HtmlForm 0 0 0
ctl04 System.Web.UI.LiteralControl 0 0 0
LinkButton1 System.Web.UI.WebControls.LinkButton 0 0 0
ctl05 System.Web.UI.LiteralControl 0 0 0
SiteMapPath1 System.Web.UI.WebControls.SiteMapPath 0 0 0
ctl06 System.Web.UI.LiteralControl 0 0 0
Panel1 System.Web.UI.WebControls.Panel 0 0 0
ctl07 System.Web.UI.LiteralControl 0 0 0
FormView1 System.Web.UI.WebControls.FormView 0 0 32
FormView1$ctl00 System.Web.UI.WebControls.ChildTable 0
0 0
FormView1$ctl01
System.Web.UI.WebControls.FormViewRow 0 0 0
FormView1$ctl02
System.Web.UI.WebControls.TableCell 0 0 0
FormView1$ctl03
System.Web.UI.WebControls.FormViewRow 0 0 0
FormView1$ctl04
System.Web.UI.WebControls.TableCell 0 0 0
FormView1$ctl05
System.Web.UI.LiteralControl 0 0 0
FormView1$RequiredFieldValidator1
System.Web.UI.WebControls.RequiredFieldValidator 0 0 0
FormView1$ctl06
System.Web.UI.LiteralControl 0 0 0
FormView1$TitleTextBox
System.Web.UI.WebControls.TextBox 0 0 0
FormView1$ctl07
System.Web.UI.LiteralControl 0 0 0
FormView1$RangeValidator1
System.Web.UI.WebControls.RangeValidator 0 0 0
FormView1$ctl08
System.Web.UI.LiteralControl 0 0 0
FormView1$RequiredFieldValidator2
System.Web.UI.WebControls.RequiredFieldValidator 0 0 0
FormView1$ctl09
System.Web.UI.LiteralControl 0 0 0
FormView1$textPrice
System.Web.UI.WebControls.TextBox 0 0 0
FormView1$ctl10
System.Web.UI.LiteralControl 0 0 0
FormView1$DescriptionTextBox
System.Web.UI.WebControls.TextBox 0 0 0
FormView1$ctl11
System.Web.UI.LiteralControl 0 0 0
FormView1$EmailTextBox
System.Web.UI.WebControls.TextBox 0 0 0
FormView1$ctl12
System.Web.UI.LiteralControl 0 0 0
FormView1$RegularExpressionValidator2
System.Web.UI.WebControls.RegularExpressionValidator 0 0 0
FormView1$ctl13
System.Web.UI.LiteralControl 0 0 0
FormView1$LinkCancel
System.Web.UI.WebControls.LinkButton 0 0 0
FormView1$ctl14
System.Web.UI.LiteralControl 0 0 0
FormView1$LinkNext
System.Web.UI.WebControls.LinkButton 0 0 0
FormView1$ctl15
System.Web.UI.LiteralControl 0 0 0
FormView1$InsertButton
System.Web.UI.WebControls.LinkButton 0 0 0
FormView1$ctl16
System.Web.UI.LiteralControl 0 0 0
FormView1$ctl17
System.Web.UI.WebControls.FormViewRow 0 0 0
FormView1$ctl18
System.Web.UI.WebControls.TableCell 0 0 0
ctl08 System.Web.UI.LiteralControl 0 0 0
SqlDataSource1 System.Web.UI.WebControls.SqlDataSource 0 0
0
ctl09 System.Web.UI.LiteralControl 0 0 0
ctl10 System.Web.UI.LiteralControl 0 0 0
Panel2 System.Web.UI.WebControls.Panel 0 0 0
ctl11 System.Web.UI.LiteralControl 0 0 0
ctl12 System.Web.UI.LiteralControl 0 0 0
ctl13
 
Presuming the simple answer is not Formview, I have a need to loop
through a formview and check the IDs for .. I too am stuck wondering
what to do with CHILDTABLE?

The for loop only returns one count of ChildTable.. NOW WHAT? If
findcontrol can find it, why can't I loop through it as a collection?


Function ValidData(ByVal whichformview As FormView) As Boolean
Dim returnvalue As Boolean = True
Dim what, what2, what3, what4 As String
For Each c As Control In whichformview.Controls


If c.GetType().ToString =
"System.Web.UI.WebControls.TextBox" Then
If c.ClientID.Contains("_date") Then
End If
If c.ClientID.Contains("_num") Then
End If
If c.ClientID.Contains("_req") Then
If CType(c, TextBox).Text = Nothing Then
StatusLabel.Text = +c.ID + "is Required" +
vbCrLf
c.Focus()
returnvalue = False
End If
End If
End If
Next
Return returnvalue

End Function
 
Back
Top