469,282 Members | 1,977 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Display records similar to Classic ASP using DataList or Repeater


Hi,

I have to display a sequence of records in an Aspx page. The problem
is, i have to display the records by checking conditions like Classic
ASP.

For example, consider an employee table. In my case the employees'
details should be displayed in Alphabetical order.The employee names
starting with "A" should display two extra HTML rows showing some more
details.

I've to display the employee name starting with "B"(Only one row) as
bold and Consequent records(Starting with "C","D","E",...) should be
shown without bold.

The controls may be either Repeater or Datalist, but not DataGrid. I
prefer using Repeater.

This scenario can be well done in ASP. But in ASP.NET it is an
headbreaking issue for me. Is ASP.NET not that powerful like ASP? I
have to migrate at any cost.

Does anyone know how to achieve it?
Thanks in advance


Kas_Aspnet

--
Kas_aspnet
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #1
1 2056
I have no idea how you achieve the goal in classic ASP, but in ASP.NET it is
pretty straightforward.

Repeater is fine. You need to make an ItemTemplate that will suit all your
requirements. It should include two extra rows for the employees with names
starting with 'A'. You need to handle either DataItemBound or PreRender
event. In the event you can access item data to get the employee name.
Depending on the name you will set appropriate visual properties for the
elements in the ItemTemplate. If the name start with 'A', you will hide two
extra rows. If the name start with 'B', you will set item to font to bold.
There are also other ways of achieving the same result, but setting
properties in code-behind events is the most flexible one.

Eliyahu

"Kas_aspnet" <Ka***************@mail.codecomments.com> wrote in message
news:Ka***************@mail.codecomments.com...

Hi,

I have to display a sequence of records in an Aspx page. The problem
is, i have to display the records by checking conditions like Classic
ASP.

For example, consider an employee table. In my case the employees'
details should be displayed in Alphabetical order.The employee names
starting with "A" should display two extra HTML rows showing some more
details.

I've to display the employee name starting with "B"(Only one row) as
bold and Consequent records(Starting with "C","D","E",...) should be
shown without bold.

The controls may be either Repeater or Datalist, but not DataGrid. I
prefer using Repeater.

This scenario can be well done in ASP. But in ASP.NET it is an
headbreaking issue for me. Is ASP.NET not that powerful like ASP? I
have to migrate at any cost.

Does anyone know how to achieve it?
Thanks in advance


Kas_Aspnet

--
Kas_aspnet
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jeremy Ames | last post: by
16 posts views Thread by William Buchanan | last post: by
4 posts views Thread by Guy | last post: by
3 posts views Thread by Augustin Prasanna | last post: by
7 posts views Thread by Dave | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.