Collection replace in repeater

L

Leon Mayne

Could someone advise on what would be the best practice for the below
problem?

I am making a generalised search function which returns a record type (e.g.
Employee, Department), the Id of the record, and the record's name, e.g.

RecordType | RecordId | RecordName
-----------------------------------------
Department | 4 | IT Dev
Department | 5 | IT Support
Employee | 2 | Norbit

I need to display the info on a webform using a repeater, including a link
to edit the item in question, e.g.
<a href="EditDepartment.aspx?DepartmentId=4">
<a href="EditEmployee.aspx?EmployeeId=2">
Etc.

What the best way to do this? I could put a collection in the ASPX file
using the RecordType as the key and the URL format string as the value?
Reshape the datatable that gets returned from the database? Hook into the
ItemDatabound event of the repeater? Any ideas?
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top