473,769 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeater

I'm trying to use the repeater control to create a column-like row of
data, I've searched the net and it doesn't appear to be that easy. Use
this page for reference:

http://www.westmarkadvisors.com/photo_gallery.php (i'm converting this
to .net)

I'm using the repeater to list all of the thumnails below, but i don't
know how to insert a </tr><tr> break in the code.
AlternatingItem Template seems to affect every other row, and as you can
see this needs to affect every four rows.

So basically I have four of these:

<td width="25%" valign="middle" align="center" class="img_sub" >
<a href="?p=&photo =1"><img
src="orig_image s/Church_FrontVie w_th.gif" border="0" alt=""
class="bdr_whit e_th"></a><br>Front View
</td>

then i need to add this:

</tr>
<tr>

and then continue with the <td> cells. Can i accomplish this with the
repeater? or do i have to use DataList?

Any help would be greatly appreciated.

Apr 20 '06 #1
7 2079

a better newsgroup would be:
"Doug Parker" <dr******@phres hdesign.com> wrote in message
news:11******** **************@ t31g2000cwb.goo glegroups.com.. .
I'm trying to use the repeater control to create a column-like row of
data, I've searched the net and it doesn't appear to be that easy. Use
this page for reference:

http://www.westmarkadvisors.com/photo_gallery.php (i'm converting this
to .net)

I'm using the repeater to list all of the thumnails below, but i don't
know how to insert a </tr><tr> break in the code.
AlternatingItem Template seems to affect every other row, and as you can
see this needs to affect every four rows.

So basically I have four of these:

<td width="25%" valign="middle" align="center" class="img_sub" >
<a href="?p=&photo =1"><img
src="orig_image s/Church_FrontVie w_th.gif" border="0" alt=""
class="bdr_whit e_th"></a><br>Front View
</td>

then i need to add this:

</tr>
<tr>

and then continue with the <td> cells. Can i accomplish this with the
repeater? or do i have to use DataList?

Any help would be greatly appreciated.

Apr 20 '06 #2
a better newsgroup would be:

microsoft.publi c.dotnet.framew ork.aspnet

However.... you want to investigate the DataList control.

I think you need a DataList ... nested inside a Repeater.

this might help.

http://www.code101.com/Code101/Displ...le.aspx?cid=68

"Doug Parker" <dr******@phres hdesign.com> wrote in message
news:11******** **************@ t31g2000cwb.goo glegroups.com.. .
I'm trying to use the repeater control to create a column-like row of
data, I've searched the net and it doesn't appear to be that easy. Use
this page for reference:

http://www.westmarkadvisors.com/photo_gallery.php (i'm converting this
to .net)

I'm using the repeater to list all of the thumnails below, but i don't
know how to insert a </tr><tr> break in the code.
AlternatingItem Template seems to affect every other row, and as you can
see this needs to affect every four rows.

So basically I have four of these:

<td width="25%" valign="middle" align="center" class="img_sub" >
<a href="?p=&photo =1"><img
src="orig_image s/Church_FrontVie w_th.gif" border="0" alt=""
class="bdr_whit e_th"></a><br>Front View
</td>

then i need to add this:

</tr>
<tr>

and then continue with the <td> cells. Can i accomplish this with the
repeater? or do i have to use DataList?

Any help would be greatly appreciated.

Apr 20 '06 #3
Hi,

You can use a repeater or a datalist, the difference is that with a repeater
you have to generate your table, like:
<table>
<asp:repeater ..... >
<itemtemplate >
<tr>
<td> YOUR CONTENT HERE </td>
</tr>
</itemtemplate>
</asp:repeater ..... >
</table>
Whether using DataList or DataGrid the control generate the table for you.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Doug Parker" <dr******@phres hdesign.com> wrote in message
news:11******** **************@ t31g2000cwb.goo glegroups.com.. .
I'm trying to use the repeater control to create a column-like row of
data, I've searched the net and it doesn't appear to be that easy. Use
this page for reference:

http://www.westmarkadvisors.com/photo_gallery.php (i'm converting this
to .net)

I'm using the repeater to list all of the thumnails below, but i don't
know how to insert a </tr><tr> break in the code.
AlternatingItem Template seems to affect every other row, and as you can
see this needs to affect every four rows.

So basically I have four of these:

<td width="25%" valign="middle" align="center" class="img_sub" >
<a href="?p=&photo =1"><img
src="orig_image s/Church_FrontVie w_th.gif" border="0" alt=""
class="bdr_whit e_th"></a><br>Front View
</td>

then i need to add this:

</tr>
<tr>

and then continue with the <td> cells. Can i accomplish this with the
repeater? or do i have to use DataList?

Any help would be greatly appreciated.

Apr 20 '06 #4
I think you are looking for a nested repeater.

<repeater>
<tr>
<repeater>
generate you 4 accross
</repeater>
</tr>
</repeater>

it's easy enough to set up a releation in the dataset or whatever you
are using to populate this.

Apr 20 '06 #5
OK - so I use a nested repeater, but in reading more about them it
appears that they are used to fill out child records. In your example,
how would I tell the inner repeater to display only 4 of the X number
of records in the set before going to the outer repeater?

Apr 20 '06 #6
Do you have some ID in the records that you could filter on?

Apr 21 '06 #7
i have a auto-incrementing id, but i don't see how i could get the
"</tr><tr>" tag in there even with the number. do i literally have to
create a record with a value of "</tr><tr>"?

this seems a little ridiculous to me that you have this little control
over the display of records. i could accomplish this using a stupid
little for loop in php (below) - is it really this difficult to
accomplish in c#?

<?
for ($i=1;$i<image_ count;$i++)
{
?>
<td width="25%" valign="middle" align="center" class="img_sub" >
<a href="?p=<?page ?>&photo=<?i?>" ><img
src="<?path?><? photos[$i]['thumb']?>" border="0" alt=""
class="bdr_whit e_th"></a><br>
<?photos[$i]['sub']?>
</td>
<?
if ($i == $marker)
{
?>
</tr>
<tr>
<?
$marker += $offset;
}
}
?>

</tr>
</table>

<?
}
}
?>

Apr 22 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5404
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to get the code in a text file. > >Thanks - Ed >
8
4279
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue which is related to the repeater. In the code shown below, if I call Repeater1.Controls.Count in the OnInit (the code fragment was highlighted in yellow) , the viewstate for the repeater will be lost during the postback. You can re-produce this...
8
2917
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server"> <HeaderTemplate><table> </HeaderTemplate> <ItemTemplate>
2
1913
by: mark | last post by:
(not sure if this is the correct group) My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater to work just fine, as long as it's not nested within the first repeater. If it is nested within the first repeater, I don't get any data. If I put the second repeater as a separate repeater, not nested, it works fine. Here's my actual code,...
2
1916
by: GD | last post by:
I'd like to use a Repeater to display data coming back from a cross-tab report. Because it's a cross-tab, I generally don't know how many columns are coming back. They do follow a certain format: e.g. CompanyName, c1, c2, c3, etc .. The current format of my repeater is: <table> <asp:Repeater ID="rptCompanies" Runat="server">
8
3026
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the way I'm going about doing this might be a little off. I'd appreciate some help. Below is the code I have thus far but I'm not sure how to reference the user control within the foreach loop. <asp:Panel ID="pnlRosterProfile" runat="Server" />
4
4923
by: Brad Baker | last post by:
I'm going a little crazy :) I'm trying to bind a repeater control to a dataset on page load using the following code: if (Request.QueryString != null) { string customerid = Request.QueryString; //open connection SqlConnection m_conn = new SqlConnection("Server=server; Database=database; UId=username; Pwd=password");
0
4095
by: uncensored | last post by:
Hello everyone, I'm fairly new at .Net and I have a repeater inside a repeater problem. I will attach my code to this message but basically what I am able to tell when I run my page it tells me that my second repeater has the following error, System.NullReferenceException: Object reference not set to an instance of an object. When I put a watch on I can see my second repeater is not being created because it is equal to "Nothing". I can...
7
3008
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm attempting to bind a user control I've written, "ImageBox", to a repeater. The user control takes a custom property, "ContentID", that will execute a database lookup and load an image.
3
3965
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or maybe the repeater control doesn't have the capabilities...? The page needs to display a custom number of sections that appear the same but have different data..
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.