Muhammad Atif Agha
Muhammad Atif Agha

Reputation: 1545

Repeator in VisualStudio ASP.Net

I am using Repeater Control in ASP.Net. But i get a lot of errors if i try to bind any thing to text field or like that because of double quote (").

its like

<asp:Repeater runat="server">
  <ItemTemplate>
     <%# DataBinder.Eval(Container.DataItem, "orderid") %>
     <hr>
     <%# DataBinder.Eval(Container.DataItem, "orderdate") %>
  </ItemTemplate>
  <SeparatorTemplate>
    <br>
  </SeparatorTemplate>
</asp:Repeater>

if i want that text field should also be repeated and orderid and orderdate should come in text field. What is the best way of that.

Regards Atif

Upvotes: 0

Views: 169

Answers (1)

Naveed Butt
Naveed Butt

Reputation: 2901

Try using this...

  <ItemTemplate>
     <%# DataBinder.Eval(Container.DataItem, "orderid").ToString().Replace("\"", "'") %>
     <hr>
     <%# DataBinder.Eval(Container.DataItem, "orderdate").ToString().Replace("\"", "'") %>
  </ItemTemplate>

Upvotes: 1

Related Questions