I have build a masterpage, the Content[pageholder have i included in the page where i would like to use a Repeater. But somehome this doesn't word. somebody help me!!
aspx:
<%@ Page MasterPageFile="~/MasterPage.master" %>
<asp:Content ID="m_oContentRenters" ContentPlaceHolderID="PlaceHolderMookBeheer" runat="server">
<asp:Repeater id="m_oRepeaterTest" runat="server">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "TES_Name")%>
</ItemTemplate>
</asp:Repeater>
</asp:Content>
aspx.cs:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Content : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string sQry = string.Format(@"SELECT * FROM TblTest");
string connectionString = ConfigurationManager.ConnectionStrings["Test"].ConnectionString;
SqlConnection conDotNet = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand(sQry, conDotNet);
conDotNet.Open();
SqlDataReader dtrCat = cmd.ExecuteReader();
m_oRepeaterTest.DataSource = "TEst";
m_oRepeaterTest.DataBind();
}
}