By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,955 Members | 1,477 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,955 IT Pros & Developers. It's quick & easy.

How can I show 2 records beside each other?

P: n/a
Hi folks

I want to show 2 records on a page side by side. Each record has an image
which will be displayed and a bit of text.

How can I do this?

Thanks

Will
Mar 12 '06 #1
Share this Question
Share on Google+
16 Replies


P: n/a
Do you mean only two records or many records in two by two?

Elton Wang

"William Buchanan" wrote:
Hi folks

I want to show 2 records on a page side by side. Each record has an image
which will be displayed and a bit of text.

How can I do this?

Thanks

Will

Mar 12 '06 #2

P: n/a
Thanks for the reply.

I have a table with around 100 records. I want to show the records 2 at a
time.

They need to be beside each other since each one has a large image
associated with it (so each record will occupy half of the page).

PS. I am using ASP.NET 2.0

Will

"Elton W" <El****@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
Do you mean only two records or many records in two by two?

Elton Wang

"William Buchanan" wrote:
Hi folks

I want to show 2 records on a page side by side. Each record has an image
which will be displayed and a bit of text.

How can I do this?

Thanks

Will


Mar 12 '06 #3

P: n/a
Look into the Repeater object.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in message
news:Op**************@TK2MSFTNGP14.phx.gbl...
Hi folks

I want to show 2 records on a page side by side. Each record has an image which will be displayed
and a bit of text.

How can I do this?

Thanks

Will

Mar 12 '06 #4

P: n/a
Again, as suggested earlier, look into the Repeater object.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in message
news:u%****************@tk2msftngp13.phx.gbl...
Thanks for the reply.

I have a table with around 100 records. I want to show the records 2 at a
time.

They need to be beside each other since each one has a large image
associated with it (so each record will occupy half of the page).

PS. I am using ASP.NET 2.0

Will

"Elton W" <El****@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
Do you mean only two records or many records in two by two?

Elton Wang

"William Buchanan" wrote:
Hi folks

I want to show 2 records on a page side by side. Each record has an image
which will be displayed and a bit of text.

How can I do this?

Thanks

Will


Mar 12 '06 #5

P: n/a
I have looked into the repeater object. As far as I could see, you can bind
it to the data of the current record only.

Are you saying it is possible to bind it to the next record as well?

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oy*************@TK2MSFTNGP10.phx.gbl...
Look into the Repeater object.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in
message news:Op**************@TK2MSFTNGP14.phx.gbl...
Hi folks

I want to show 2 records on a page side by side. Each record has an image
which will be displayed and a bit of text.

How can I do this?

Thanks

Will


Mar 12 '06 #6

P: n/a
re:
I want to show 2 records on a page side by side. Are you saying it is possible to bind it to the next record as well?


That doesn't seem so impossible to do.

See a sample at :
http://www.dotnetjunkies.com/quickst.../Pagelet6.aspx

The source for that is at :
http://www.dotnetjunkies.com/quickst...s/Pagelet6.src


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...I have looked into the repeater object.
As far as I could see, you can bind it to the data of the current record only.

Are you saying it is possible to bind it to the next record as well? "Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oy*************@TK2MSFTNGP10.phx.gbl...
Look into the Repeater object.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in message
news:Op**************@TK2MSFTNGP14.phx.gbl...
Hi folks

I want to show 2 records on a page side by side. Each record has an image which will be
displayed and a bit of text.

How can I do this?

Thanks

Will

Mar 13 '06 #7

P: n/a
On Sun, 12 Mar 2006 23:38:09 -0000, William Buchanan wrote:
I have looked into the repeater object. As far as I could see, you can bind
it to the data of the current record only.

Are you saying it is possible to bind it to the next record as well?


Stop and think for a moment. How exactly could it be a "repeater" control
if it could only bind to one record?
Mar 13 '06 #8

P: n/a
Hi William,

You can use either Repeater or DataList to do it. Either one can be bound
with data source (DataSource, ObjectDataSource, or DataTable/DataSet which
retireve data). Repeater or DataList will loop thru data records for you and
you can give its layout in a more flexible style (compare to GridView and
DataGrid).

HTH

Elton Wang

"William Buchanan" wrote:
Thanks for the reply.

I have a table with around 100 records. I want to show the records 2 at a
time.

They need to be beside each other since each one has a large image
associated with it (so each record will occupy half of the page).

PS. I am using ASP.NET 2.0

Will

"Elton W" <El****@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
Do you mean only two records or many records in two by two?

Elton Wang

"William Buchanan" wrote:
Hi folks

I want to show 2 records on a page side by side. Each record has an image
which will be displayed and a bit of text.

How can I do this?

Thanks

Will


Mar 13 '06 #9

P: n/a
That is not what I said. If you read my posting again I said "current
record".

The actual problem is that I want it to bind to the current and the next
record.
"Erik Funkenbusch" <er**@despam-funkenbusch.com> wrote in message
news:hn***************@funkenbusch.com...
On Sun, 12 Mar 2006 23:38:09 -0000, William Buchanan wrote:
I have looked into the repeater object. As far as I could see, you can
bind
it to the data of the current record only.

Are you saying it is possible to bind it to the next record as well?


Stop and think for a moment. How exactly could it be a "repeater" control
if it could only bind to one record?

Mar 13 '06 #10

P: n/a
Thanks for the reply. I am missing something so please bear with me!

I can see how the repeater can be used to repeatedly display all records in
a table (as can a datalist). However, I only want to see 2 records at a
time. This means that I need to show the first 2 records, then when I click
"Next" it will show the next 2 records, and so on.

I know this can be done through lots of code, but I was hoping that there
would be some way of doing it by using the data components.

Will

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
re:
I want to show 2 records on a page side by side.

Are you saying it is possible to bind it to the next record as well?


That doesn't seem so impossible to do.

See a sample at :
http://www.dotnetjunkies.com/quickst.../Pagelet6.aspx

The source for that is at :
http://www.dotnetjunkies.com/quickst...s/Pagelet6.src


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in
message
news:uh**************@tk2msftngp13.phx.gbl...
I have looked into the repeater object.
As far as I could see, you can bind it to the data of the current record
only.

Are you saying it is possible to bind it to the next record as well?

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oy*************@TK2MSFTNGP10.phx.gbl...
Look into the Repeater object.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in
message
news:Op**************@TK2MSFTNGP14.phx.gbl...
Hi folks

I want to show 2 records on a page side by side. Each record has an
image which will be
displayed and a bit of text.

How can I do this?

Thanks

Will


Mar 13 '06 #11

P: n/a
Is this (http://aspnet.4guysfromrolla.com/articles/081804-1.aspx) the
sort of thing that you're looking for?

Mar 13 '06 #12

P: n/a
On Mon, 13 Mar 2006 08:53:25 -0000, William Buchanan wrote:
That is not what I said. If you read my posting again I said "current
record".
This is incorrect. The repeater binds to as many records as you have in a
dataset. If your dataset contains one record, it will bind to the current
record. If it contains two records, it will bind to two records, etc..
The actual problem is that I want it to bind to the current and the next
record.


Easily solveable by using a paging algorithm. Sajarki points you to one
example, another is here:

http://weblogs.sqlteam.com/jeffs/arc...3/22/1085.aspx

This returns as many records as you want at a time, and lets you set the
"next" and "previous" controls to get the next or previous set.
Mar 13 '06 #13

P: n/a
That is exactly what I was after!

Many thanks.

Will
"Sajaraki" <iv*********@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Is this (http://aspnet.4guysfromrolla.com/articles/081804-1.aspx) the
sort of thing that you're looking for?

Mar 13 '06 #14

P: n/a
Thanks

"Erik Funkenbusch" <er**@despam-funkenbusch.com> wrote in message
news:1n****************@funkenbusch.com...
On Mon, 13 Mar 2006 08:53:25 -0000, William Buchanan wrote:
That is not what I said. If you read my posting again I said "current
record".


This is incorrect. The repeater binds to as many records as you have in a
dataset. If your dataset contains one record, it will bind to the current
record. If it contains two records, it will bind to two records, etc..
The actual problem is that I want it to bind to the current and the next
record.


Easily solveable by using a paging algorithm. Sajarki points you to one
example, another is here:

http://weblogs.sqlteam.com/jeffs/arc...3/22/1085.aspx

This returns as many records as you want at a time, and lets you set the
"next" and "previous" controls to get the next or previous set.

Mar 13 '06 #15

P: n/a
What you're looking for is Paging.
It doesn't take much coding to implement it.

The reference you were given :
http://aspnet.4guysfromrolla.com/articles/081804-1.aspx
is an excellent guide.

There's other approaches, like :
http://www.411asp.net/func/content?t...gre&id=4628710
and
http://www.vbdotnetheaven.com/Code/Sept2003/2173.asp

Here's a ready-made PagingRepeater control, complete with its free code,
which you could probably easily adapt to your needs :

http://www.codeproject.com/aspnet/pagingrepeater.asp

You'll need to join the Code Project to download the code,
but it's free and they don't bug you with spam.

Good luck!

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:OM**************@TK2MSFTNGP14.phx.gbl...
Thanks for the reply. I am missing something so please bear with me!

I can see how the repeater can be used to repeatedly display all records in a table (as can a
datalist). However, I only want to see 2 records at a time. This means that I need to show the
first 2 records, then when I click "Next" it will show the next 2 records, and so on.

I know this can be done through lots of code, but I was hoping that there would be some way of
doing it by using the data components.

Will "Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
re:
I want to show 2 records on a page side by side.
Are you saying it is possible to bind it to the next record as well?


That doesn't seem so impossible to do.

See a sample at :
http://www.dotnetjunkies.com/quickst.../Pagelet6.aspx

The source for that is at :
http://www.dotnetjunkies.com/quickst...s/Pagelet6.src


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in message
news:uh**************@tk2msftngp13.phx.gbl...
I have looked into the repeater object.
As far as I could see, you can bind it to the data of the current record only.

Are you saying it is possible to bind it to the next record as well?

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oy*************@TK2MSFTNGP10.phx.gbl...
Look into the Repeater object.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in message
news:Op**************@TK2MSFTNGP14.phx.gbl...
> Hi folks
>
> I want to show 2 records on a page side by side. Each record has an image which will be
> displayed and a bit of text.
>
> How can I do this?
>
> Thanks
>
> Will



Mar 13 '06 #16

P: n/a
Great - thanks for all your help.

Will
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Ol**************@TK2MSFTNGP11.phx.gbl...
What you're looking for is Paging.
It doesn't take much coding to implement it.

The reference you were given :
http://aspnet.4guysfromrolla.com/articles/081804-1.aspx
is an excellent guide.

There's other approaches, like :
http://www.411asp.net/func/content?t...gre&id=4628710
and
http://www.vbdotnetheaven.com/Code/Sept2003/2173.asp

Here's a ready-made PagingRepeater control, complete with its free code,
which you could probably easily adapt to your needs :

http://www.codeproject.com/aspnet/pagingrepeater.asp

You'll need to join the Code Project to download the code,
but it's free and they don't bug you with spam.

Good luck!

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@freenet.co.uk> wrote in message
news:OM**************@TK2MSFTNGP14.phx.gbl...
Thanks for the reply. I am missing something so please bear with me!

I can see how the repeater can be used to repeatedly display all records
in a table (as can a datalist). However, I only want to see 2 records at
a time. This means that I need to show the first 2 records, then when I
click "Next" it will show the next 2 records, and so on.

I know this can be done through lots of code, but I was hoping that there
would be some way of doing it by using the data components.

Will

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
re:
> I want to show 2 records on a page side by side.
Are you saying it is possible to bind it to the next record as well?

That doesn't seem so impossible to do.

See a sample at :
http://www.dotnetjunkies.com/quickst.../Pagelet6.aspx

The source for that is at :
http://www.dotnetjunkies.com/quickst...s/Pagelet6.src


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in
message
news:uh**************@tk2msftngp13.phx.gbl...
I have looked into the repeater object.
As far as I could see, you can bind it to the data of the current
record only.

Are you saying it is possible to bind it to the next record as well?

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oy*************@TK2MSFTNGP10.phx.gbl...
> Look into the Repeater object.
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en español : http://asp.net.do/foros/
> ===================================
> "William Buchanan" <wi**************@naespamfreenet.co.uk> wrote in
> message
> news:Op**************@TK2MSFTNGP14.phx.gbl...
>> Hi folks
>>
>> I want to show 2 records on a page side by side. Each record has an
>> image which will be
>> displayed and a bit of text.
>>
>> How can I do this?
>>
>> Thanks
>>
>> Will



Mar 13 '06 #17

This discussion thread is closed

Replies have been disabled for this discussion.