473,769 Members | 7,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(Startin g 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 2329
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.codeco mments.com> wrote in message
news:Ka******** *******@mail.co decomments.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(Startin g 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4956
by: olle | last post by:
Hi everyone. Beging a newbee to asp.net and used to work with traditional asp I have one problem working with a datalist. 1/ I make a dataset as as session variable like session("employees") 2/ I want the datalist do display only the first row of the table. But it always fails. tried for exemple: dim nrowpos as ingeger 'shows the current rowposition dim dv as dataview
3
1801
by: Jeremy Ames | last post by:
I am trying to use a datagrid to pull information from a database. I prefer to use latebinding to this. Well, I finally got my information to populate the datagrid, but the information came out in a table format. Is there a way that I can make the datagrid use list box or some other kind of grid? Perhaps I am using the wrong components. Someone please help.
4
1096
by: darrel | last post by:
I've been working on a few userControls that display data. I've been using datalists and repeater controls for this. I bind the data to the datalist or repeater, then display it. However, sometimes I just need to pull up one record. Is it incorrect to use a datalist or repeater to just show one record? Is there a different control I should be binding data to when only showing one record? -Darrel
4
2517
by: Patrick.O.Ige | last post by:
I'm DataBinding a CheckBoxList and i want to get the checkboxes selected when the page is loaded depending on a Boolean value from the Database.. chkDebtor.DataSource = objDR chkDebtor.DataValueField = "checked" -- this is a column in the table that returns 1 or 0 chkDebtor.DataTextField = "DebtorCode" chkDebtor.DataBind() Dim i As Integer = 0 While i < chkDebtor.Items.Count
16
1768
by: William Buchanan | last post by:
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
4
1288
by: Guy | last post by:
I'm a little bit confused as what is the bes way to achieve the following: I have 2 database tables, table 1 product en table 2 image. For every product record there can be 0-1 or more image records. My question: What is the best way to display the product record with the respective image record(s)? Using a FormView for the product record and a GridView/DataList for the image record(s)? Or, writing own code (using Table, Row, Cells and...
3
2182
by: Augustin Prasanna | last post by:
I need to display some 200 records (dynamic) on the screen.. I need to display records from 2 tables (one to many relationship) output would look like Customer Id Name Phone NO 1 abc 23949495 34945959
6
2052
by: Ken Fine | last post by:
I'm using SQLDataSource, which generates some kind of dataset, and then I attach that datasource to various data display controls such as DataList and repeater which loop through to the end of the data that was retrieved by the query. At times I may want the display control only to render some items in the set of data returned by SqlDataSource. There would be several scenarios: * render the second data item or third item in to the end...
7
1568
by: Dave | last post by:
I'm stuck on something and I've been trying to find some examples on it. I'm trying to show the data to my users as such: year1 year2 Q1 Q2 Q1 Q2 Smith my dataset looks like this: <?xml version="1.0" standalone="yes"?> <NewDataSet>
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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
5309
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

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.