Repeaters in Tables

    Date: 01/26/06 (Asp Dot Net)    Keywords: html, database, asp, sql, web

    Ok... Apparently I'm getting a brain cramp here..

    I'm trying to get a repeater to work on an ASP.Net page in a table. For some reason even though I have an example copied DIRECTLY from a website I can't get the damn thing to work properly. I keep getting errors on the HTML side saying like, "Per the active schema, the element 'tr' cannot be nested within 'form'.", and "The active schema does not support the element 'ItemTemplate'.

    And when the page is run, I get the error: 'DataItem' is not a member of 'System.Web.UI.Control'.

    Here's part of the code. Its not 100% complete because this problem is preventing me from proceeding in testing.

    form id="Form1" method="post" runat="server">

    asp:Repeater id="parentRepeater" runat="server">

    HeaderTemplate>
    table>
    tr bgcolor="RosyBrown">
    th>
    %# DataBinder.Eval(Container.DataItem, "infoName") %>
    /th>
    /tr>
    /HeaderTemplate>

    ItemTemplate>
    tr bgcolor="#ffcccc">
    td Performance Objectives/td>
    /tr>
    tr>
    td objectives/td>
    /tr>
    tr>
    td Intended Audience/td>
    /tr>
    tr>
    td> <%# DataBinder.Eval(Container.DataItem, "infoIntendAud") %> /td>




-->

The Code-Behind:
Dim sDSN As String = System.Configuration.ConfigurationSettings.AppSettings("DSN2")
sCmd = "SELECT * FROM courseInfo WHERE infoID=" & queryID & ""
Dim sReqID As String
iReturnCode = oDataAccess.ExecuteSqlStatement(sDSN, sCmd, dsCourses, sErrMsg)
parentRepeater.DataSource = dsCourses.Tables(0)


Page.DataBind()

The iReturnCode thing is part of a utility class that we use for Database queries.


I know the code here looks REALLY weird but LJ is being a bad word that rhymes with runt and is actually compiling the code that I'm posting. I don't know if thats good or bad, but all I Know is that its not running on my machine and I'm getting these complilation errors. The <'s and >'s were modified to get it to display, but I think you get the idea.
Any help would be appreciated. Am I just going insane? This seems like such a simple thing yet it just doesn't seem to want to work.

Source: http://community.livejournal.com/aspdotnet/56888.html

« sessions and .aspx page || Disable Enter key posting... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home