formview child controls .. added a table and broke control loop??

J

jobs

Well, I've narrowed the issue down to having added a table inside my
formview. Somehow I must figure out how to navigate the formview
controls around a table, likely another child control or layer to
think about .. it boils down to this:



what does this table..

<table style="width: 625px">
<tr>
<td style="width: 309px; height:
214px" valign="top">
<asp:Label ID="UserNameLabel"
SkinID="Retailer" runat="server" Text="UserName:" /><br />
<asp:TextBox ID="UserName"



do to this ..(that use to work before it)

the function:

Function FormviewErrors(ByVal whichformview As FormView) As
String
Dim Errors As String = Nothing


'Dim zipcode As TextBox =
CType(whichformview.FindControl("ZipCodeTextBox"), TextBox)
'Dim zip As String = zipcode.Text.ToString
Dim fcc As Integer =
whichformview.Controls(0).Controls(2).Controls.Count



Dim fr As FormViewRow =
(CType(whichformview.Controls(0).Controls(1), FormViewRow))
Dim tc As TableCell = fr.Cells(0)
For i As Integer = tc.Controls.Count To 1 Step -1
Dim c As Control = tc.Controls(i - 1)

Dim x As String = c.ClientID.ToString
Dim xx As String = c.GetType().ToString

If c.GetType().ToString =
"System.Web.UI.WebControls.TextBox" Then
Dim Tbox As TextBox = CType(c, TextBox)


my formview:

BackColor="Transparent" GridLines="Both" Width="400px"
DataSourceID="DSForm"
DataKeyNames="UserId"
OnItemCreated="Form_ItemCreated">
<EditItemTemplate>
<div runat="Server">
<br />
<table style="width: 625px">
<tr>
<td style="width: 309px; height:
214px" valign="top">
<asp:Label ID="UserNameLabel"
SkinID="Retailer" runat="server" Text="UserName:" /><br />
<asp:TextBox ID="UserName"
<asp:Label ID="RoleLabel"
SkinID="Retailer" runat="server" Text="Role:" />
<br />
<asp:DropDownList
ID="RoleDropDown" SkinID="Retailer" runat="server"
DataValueField="RoleName"




My function thinks there are only 3 controls under the formview, there
are actually 20. I added a table with two columns and placed all
textboxes into them. I take out the table from my formview and
function (which loops through the formview checking textboxes) works
fine.

My question: how does a table inside a formview impact childcontrols
and how do I loop through the formview now?

Thanks for any help or information.
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top