Unexpected end of file looking for </HeaderTemplate>

C

CJM

I've copied (& modified) some code from MSDN which uses a Repeater control,
but I'm getting an error: Unexpected end of file looking for
</HeaderTemplate>

As far as I can see I've not made an dramatic changes, and if the MSDN code
would work, I would also expect mine to work.

As far as the </HeaderTemplate> tag is concerned, I removed it and replaced
it - but it did not appear in the Intellisense list.

I've included both the html & code snippets below.

Any help would be appreciated.

Chris

Snippets:

<form id="frmReport" method="post" runat="server">
<table id="tblRequest" class="tbl centered" cellspacing="0"
runat="server">
<tr>
<th colspan="2">
View TA Details</th>
</tr>
<tr>
<td>TA Number:</td>
<td><asp:TextBox ID="txtTANumber" MaxLength="10" Runat="server" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:Button ID="cmdSearch" Text="Search" Runat="server" /></td>
</tr>
</table>

<asp:Repeater id=rpResults runat="server">
<HeaderTemplate>
<table id="tblResults" class="tbl centered" cellspacing="0"
runat="server">
<tr>
<th>TA Number:</th>
<th><%# DataBinder.Eval(Container, "DataItem.TANumber") %></th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>PO Number:</td>
<td><%# DataBinder.Eval(Container, "DataItem.PONumber") %></td>
</tr>
<tr>
<td>PO Line:</td>
<td><%# DataBinder.Eval(Container, "DataItem.POLine") %></td>
</tr>
<tr>
<td>Part No:</td>
<td><%# DataBinder.Eval(Container, "DataItem.PartNumber") %></td>
</tr>
<tr>
<td>Part XRef:</td>
<td><%# DataBinder.Eval(Container, "DataItem.PartXref") %></td>
</tr>
<tr>
<td>Description:</td>
<td><%# DataBinder.Eval(Container, "DataItem.DescText") %></td>
</tr>
<tr>
<td>Quantity Rec'd:</td>
<td><%# DataBinder.Eval(Container, "DataItem.QuantityRecd") %></td>
</tr>
<tr>
<td>Advice Note:</td>
<td><%# DataBinder.Eval(Container, "DataItem.AdviceNote") %></td>
</tr>
<tr>
<td>Supplier ID:</td>
<td><%# DataBinder.Eval(Container, "DataItem.SupplierID") %></td>
</tr>
<tr>
<td>Cert/Cast No:</td>
<td><%# DataBinder.Eval(Container, "DataItem.CastNo") %></td>
</tr>
<tr>
<td>Date Rec'd:</td>
<td><%# DataBinder.Eval(Container, "DataItem.DateRecd") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</form>



Public Class viewta2
Inherits System.Web.UI.Page

Protected WithEvents tblRequest As HtmlTable
Protected WithEvents tblResults As HtmlTable
Protected WithEvents cmdSearch As System.Web.UI.WebControls.Button
Protected WithEvents rpResults As System.Web.UI.WebControls.Repeater
Protected WithEvents txtTANumber As TextBox


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

Dim oConn As SqlConnection
Dim oCmd As SqlCommand
Dim dtrTADetails As SqlDataReader

If IsPostBack Then
'Hide Search button
tblResults.Visible = True
tblRequest.Visible = False

oConn = New SqlConnection(Application("DB"))
oCmd = New SqlCommand("Exec TA_GetTADetails " & txtTANumber.Text, oConn)
oConn.Open()

With rpResults
.DataSource = oCmd.ExecuteReader()
.DataBind()

End With

oConn.Close()


Else
'Hide(results)
tblResults.Visible = False
tblRequest.Visible = True
End If

End Sub

End Class
 
K

Karl

Your controls aren't closing in the same order you are opening them

<headerTemplate>
<table runat="server">...
</headerTEmplate>

You need to either close the </table> inside the headerTemplate or remove
the runat="Server"

Karl
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top