Repeater Problem

F

Frank

I am having a problem with using a repeater control. I have no idea what I
am doing wrong. It compiles but nothing displays. Can anyone help? Here is
the code:


ASPX File:

<%@ Page language="c#" Codebehind="profile.aspx.cs" AutoEventWireup="false"
Inherits="MarketZar.accts.profile" %>
<html>
<head>
<mz:headsection id=Headsection1 runat="server"></mz:headsection>
</head>
<body>
<form id=Form1 runat="server">
<div align=center>
<table cellSpacing=0 cellPadding=0 width=855 border=0>
<mz:header id=Header runat="server" name="Header"></mz:header>
<mz:menu id=Menu runat="server" name="Menu"></mz:menu>
</table>
<!-- Main content table -->
<table id=main_frame_table cellSpacing=0 cellPadding=5 width=755
align=center
background=/images/maintable_bckgrnd.gif border=0>
<tr>
<td><!-- Table that contains the banners and content -->
<table id=banners_n_content cellSpacing=0 cellPadding=0 width=745
align=center border=0>
<TBODY>
<tr>
<td vAlign=top width=220><mz:leftbanner id=LeftBanner1
runat="server"></mz:leftbanner></td>
<!-- A transparent spacer cell to the right of the left-side
banners -->
<td vAlign=top>
<!-- Table that contains main content -->
<table id=main_content height=251 cellSpacing=0 cellPadding=5
width=395 bgColor=#ffffff border=0>
<TBODY>
<p>
<mz:acctsmenu id=Accts_Menu runat="server"></mz:acctsmenu>
</p>
<p align=left>
<asp:label id=Lbl1 runat="server" ForeColor="Black"
Font-Names="Verdana"></asp:label>
</p>
<asp:repeater id=Repeater1 runat="server">
<headertemplate>
<table width="300" cellpadding="2" cellspacing="2"border=1>
<tr>
<td></td>
</tr>
</headertemplate>
<itemtemplate>
<tr>
<td>
<b>Name:</b>
</td>
<td><%# DataBinder.Eval(Container.DataItem, "fname") %> <%#
DataBinder.Eval(Container.DataItem, "lname") %></td>
</tr>
<tr>
<td><b>Street:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "addr1") %><%#
DataBinder.Eval(Container.DataItem, "addr2") %> </td>
</tr>
<tr>
<td><b>City:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "city") %> </td>
</tr>
<tr>
<td><b>State:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "state") %>
</td>
</tr>
<tr>
<td><b>PostalCode:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "postalcode") %>
</td>
</tr>
<tr>
<td><b>Country:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "country") %>
</td>
</tr>
<tr>
<td><b>E-Mail:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "email") %>
</td>
</tr>
<tr>
<td><b>Phone:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "phone") %>
</td>
</tr>
<tr>
<td><b>Username:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "handle") %>
</td>
</tr>
<tr>
<td><b>Password:</b></td>
<td><%# DataBinder.Eval(Container.DataItem, "password") %>
</td>
</tr>
</itemtemplate>
<footertemplate>
</table>
</footertemplate>
</asp:repeater>
<br>
<asp:repeater id=OurRepeater runat="server">
<headertemplate>
<table width="300" cellpadding="2" cellspacing="1" border="0">
<tr>
<td colspan="3"><h3>Employees for Northwind</h3></td>
</tr>
</headertemplate>
<itemtemplate>
<tr bgcolor="#AAAAAA">
<td>
<b>Name</b>
</td>
<td><b>Title</b></td>
<td><b>Hire Date</b></td>
</tr>
<tr bgcolor="#EEEEEE">
<td><%# DataBinder.Eval(Container.DataItem, "fname") %> <%#
DataBinder.Eval(Container.DataItem, "lname") %> </td>
</tr>
<tr bgcolor="#AAAAAA">
<td><b>Address</b></td>
<td><b>City</b></td>
<td><b>Region, Postal Code, Country</b></td>
</tr>
<tr bgcolor="#EEEEEE">
<td><%# DataBinder.Eval(Container.DataItem, "addr1") %>
</td>
<td><%# DataBinder.Eval(Container.DataItem, "city") %> </td>
<td><%# DataBinder.Eval(Container.DataItem, "postalcode") %>
<%# DataBinder.Eval(Container.DataItem, "country") %> </td>
</tr>
</itemtemplate>
<footertemplate>
</table>
</FooterTemplate>
&nbsp;</p></td>
</tr>
</table>
<!-- End table main_content -->
</TD>
<td vAlign=top width=120><mz:adthree id=Adthree1 runat="server"
name="Adthree1"></mz:adthree></td>
</TR>
</TBODY>
</TABLE>
<!-- End table banners_n_content -->
<mz:footer id=Footer1 runat="server" name="Footer1"></mz:footer>
</TD>
</TR>
</TBODY>
</TABLE>
<!-- End main_frame_table -->
</div>
</form>
</body>
</html>


In Code Behind file:

private void Page_Load(object sender, System.EventArgs e)

{

if(Session.Keys.Count !=0)

{

bizObj = new Biz_Layer();DataTable dt = new DataTable("CustInfo");

handle = Session["handle"].ToString();

fname = Session["fname"].ToString();

Lbl1.Text="<b>Welcome " + fname + "</b><br><br>";

Lbl1.Text+="The following display summarizes your current
registration information<br>";

Lbl1.Text+="To update any of the information, click the accompanying
edit button.<br><br>";

Repeater1.DataSource =
bizObj.GetCustomer(Session["handle"].ToString() );

OurRepeater.DataSource =
bizObj.GetCustomer(Session["handle"].ToString() );

DataBind();

custInfo = new string[12];

}

else

Response.Redirect("/login.aspx");

}



Thanks in advance for any suggestions

Frank
 
D

DKode

first, verify that you have data when you run bizObj.GetCustomer(), if
there is nothing returned, then you know its a problem in bizObj

if you have data there, just try to print it out to a label first to
see if you can see the data. if you can, then you might have a problem
in your repeater html tags. view the source of the page and see if you
can see html outputted just not displayed. Sometimes, if you mess up
your table tags, it will render but since the browser has a problem
with the tags, it wont display
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top