Name 'Repeater1' is not declared.

Last post 05-16-2008 6:56 PM by JJ297. 4 replies.

Sort Posts:

  • Name 'Repeater1' is not declared.

    05-15-2008, 9:43 AM
    • Loading...
    • JJ297
    • Joined on 09-12-2007, 4:04 PM
    • Posts 352

    How do I get rid of this error? Repeater 1 is not declared?

    Here's the code for the repeater, I have a label present to  write no data available

    <asp:Label ID="NoDataTxt" runat="server" Style="z-index: 100; left: 421px; position: absolute;

    top: 198px" Font-Bold="True" ForeColor="Red"></asp:Label>

    <br />

     

    <center> <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">

    <ItemTemplate>

    <center><table width="90%" background="images/beige102.gif"> - At this table tag I have an error that says text is not allowed between the opening and closing tags for element table)

    <tr>

    <td colspan="2" align="left"><b><font color="Black">Claim SSN:</font> <font color="#330099"><%# Eval("ClaimSSN") %></font></b>

    </td>

    <td colspan="2" align="left"><b><font color="Black">PIC:</font><font color="#330099"><%# Eval("PIC") %></font></b>

    </td>

    <td colspan="2" align="left"><b><font color="Black">PIC SSN:</font> <font color="#330099"><%# Eval("PayeeSSN") %></font></b>

    </td>

     

    <td colspan="2" align="left"><b><font color="Black">PMT Type:</font><font color="#330099"><%#Eval("PMTTYPE")%></font></b>

    </td>

    </tr>

    <td colspan="2">

    </td>

    <td colspan="2" align="left"><b><font color="Black">PMT Amount: </font><font color="#330099"><%# Eval("PMTAMT", "{0:c2}")%></font></b>

    </td>

    <td colspan="2" align="left"><b><font color="Black">PMT Date: </font><font color="#330099"><%# Eval("PMTDate", "{0:d}")%></font></b>

    </td>

    <td colspan="2" align="left"><b><font color="Black">Status Code: </font><font color="#330099"><%# Eval("StatusCode")%></font></b>

    </td>

    </tr>

    <tr>

    <td colspan="2"></td>

    <td colspan="2"></td>

    <td colspan="2"></td>

    <td colspan="2" align="left"><b><font color="Black">Pin: </font><font color="#330099"><%#getPin(DataBinder.Eval(Container.DataItem, "Pin"))%></font></b>

    </td>

    </tr>

    <tr>

    <td colspan="100%"><hr size="1" color=#330099 /></td>

    </tr>

    </table></center>

    </ItemTemplate>

    <FooterTemplate>

    </table>

    </FooterTemplate>

    </asp:Repeater>

     Here's the page_Load

    If Repeater1.Items.Count = 0 Then

    NoDataTxt.Text = "No Data available"

     

    End If

    Protected Sub Repeater1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles Repeater1.ItemDataBound

    NoDataTxt.Visible = "false"

    End Sub

    If I comment the references to the repeater1 out it works but I need to tell the user no data is available how do I do this?

    Thanks

  • Re: Name 'Repeater1' is not declared.

    05-15-2008, 10:11 AM

    Hey Hi,

     

    JJ297:

    <FooterTemplate>

    </table>

    </FooterTemplate>

    where is the opening table tag for the above, just wondering

    Thanks

    Keyboard not found. Please Press < F1 > to RESUME

    Please Remember to Mark as Answer for the post(s) that help you.....so it can help others......Thanks
  • Re: Name 'Repeater1' is not declared.

    05-15-2008, 11:15 AM
    • Loading...
    • JJ297
    • Joined on 09-12-2007, 4:04 PM
    • Posts 352
    Thanks I didn't find one either so I deleted it.  Still gettting error BC30451: Name 'Repeater1' is not declared.  Any suggestions?

     

     

     

  • Re: Name 'Repeater1' is not declared.

    05-15-2008, 11:39 AM
    Answer

    JJ297:

    <td colspan="2" align="left"><b><font color="Black">Status Code: </font><font color="#330099"><%# Eval("StatusCode")%></font></b>

    </td>

    </tr>

    <tr>

    you are also missing a opening <tr> tag for the highlighted closing </tr>. one more thing try something like this.....

    <asp:repeater id = "repeater1" runat="server" Datasourceid = "sqldatasource1">

    <headertemplate>

    <table id ="table1">  ------------ bascially try defining your opening table tag here......

    </headertemplate>

    <itemtemplate>

    <tr>

    <td></td>

    </tr>

    </itemtemplate>

    <footertemplate>

    </table>

    </footertemplate>

    </asp:repeater>

    Keyboard not found. Please Press < F1 > to RESUME

    Please Remember to Mark as Answer for the post(s) that help you.....so it can help others......Thanks
  • Re: Name 'Repeater1' is not declared.

    05-16-2008, 6:56 PM
    • Loading...
    • JJ297
    • Joined on 09-12-2007, 4:04 PM
    • Posts 352

    Thanks for the extra set of eyes it's working!

Page 1 of 1 (5 items)