5 Replies - 1882 Views - Last Post: 29 August 2011 - 12:42 AM Rate Topic: -----

#1 Vivek Gautam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 17-September 10

Repeater problem

Posted 27 August 2011 - 12:03 AM

i have selected only one field from my table

 q = "Select field1  from table1 where Rn='101'"
            cn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=*****.mdb;jet oledb:database password=*******;")
            cn.Open()
            ds = New DataSet
            ad = New OleDbDataAdapter(q, cn)
            ad.Fill(ds, "table1")
            REPEATER1.DataSource = ds.Tables(0)
            REPEATER1.DataBind()




this is my html view

 <asp:Repeater id="REPEATER1" runat="server">
<HeaderTemplate>
<table>
<tr>
<td>Name</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
 <%#DataBinder.Eval(Container, "DataItem.field1")%>
</td>
</tr>

</ItemTemplate>

</asp:Repeater>





one thing i want to bring in your notice....my table tag is giving me problem if im using that like this...

 <asp:Repeater id="REPEATER1" runat="server">
<HeaderTemplate>
<table>

</HeaderTemplate>

</table>
</asp:Repeater>





giving error following error..
1)content ('</table>') does not match any properties within a 'System.Web.UI.WebControls.Repeater', make sure it is well-formed.
2)Cannot switch views: This end tag has no matching start tag.
3)Validation (ASP.Net): Text is not allowed between the opening and closing tags for element Repeater'.

Is This A Good Question/Topic? 0
  • +

Replies To: Repeater problem

#2 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 441
  • View blog
  • Posts: 1,488
  • Joined: 28-April 09

Re: Repeater problem

Posted 27 August 2011 - 12:58 AM

the table element is not an available control directly in the repeater, it needs to go inside one of the repeater's template controls, ie: headertemplate, itemtemplate, or footertemplate.
Was This Post Helpful? 0
  • +
  • -

#3 Vivek Gautam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 17-September 10

Re: Repeater problem

Posted 27 August 2011 - 02:42 AM

View PostNakor, on 27 August 2011 - 01:28 PM, said:

the table element is not an available control directly in the repeater, it needs to go inside one of the repeater's template controls, ie: headertemplate, itemtemplate, or footertemplate.



thnx...here is my new one...but it doesn't showing anything on page...
[code]
<asp:Repeater id="REPEATER1" runat="server">

<HeaderTemplate>
<table border="1" width="100%">
<tr>
<th>Title</th>
</tr>
</HeaderTemplate>

<ItemTemplate>
<tr>
<td><%#Container.DataItem("field1")%> </td>

</tr>
</ItemTemplate>

<FooterTemplate>
</table>
</FooterTemplate>

</asp:Repeater>
Was This Post Helpful? 0
  • +
  • -

#4 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 441
  • View blog
  • Posts: 1,488
  • Joined: 28-April 09

Re: Repeater problem

Posted 27 August 2011 - 09:06 AM

where are you performing the databinding? Is that in the page load or somewhere else?
Was This Post Helpful? 0
  • +
  • -

#5 Vivek Gautam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 17-September 10

Re: Repeater problem

Posted 28 August 2011 - 11:28 PM

View PostNakor, on 27 August 2011 - 09:36 PM, said:

where are you performing the databinding? Is that in the page load or somewhere else?

thnx for help i solved the problem.....im just abt finish this...

This post has been edited by Vivek Gautam: 28 August 2011 - 11:29 PM

Was This Post Helpful? 0
  • +
  • -

#6 Vivek Gautam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 17-September 10

Re: Repeater problem

Posted 29 August 2011 - 12:42 AM

View PostVivek Gautam, on 29 August 2011 - 11:58 AM, said:

View PostNakor, on 27 August 2011 - 09:36 PM, said:

where are you performing the databinding? Is that in the page load or somewhere else?

thnx for help i solved the problem.....im just abt finish this...

im stuck in a one more thing...that is how to display image also...im reading image from database through handler..
handler is working perfectly with Gridview but im getting stuck here with repeater control
[code]
<td>

<asp:Image ID="image1" runat ="server " ImageUrl='<%#"handler.ashx?id="eval("registration_number") %>' />
</td>
[\code]


errors--:
ashx is not a member of handler..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1