Collection replace in repeater

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leon Mayne

    #1

    Collection replace in repeater

    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="EditDepar tment.aspx?Depa rtmentId=4">
    <a href="EditEmplo yee.aspx?Employ eeId=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?

Working...