I am struggling to word this correctly as I am not really sure what the issue is but I will give it a try.
I have a list of events in a repeater. I have a checkbox above this list which does a postback and displays expired events.
When it posts back, it has the right information in the repeater, but when I click Edit (ItemCommand) it has the wrong event id (instead it shows the id of the event before postback).
I am not sure if there is some kind of id mapping going on with repeaters which is beyond my knowledge.
Here is some of my code to hopefully make things a bit clearer:
protected void chkShowExpired_CheckedChanged(object sender, EventArgs e)
{
rptEvents.DataSource = Events.GetFiltered(null, null, chkShowExpired.Checked, null, null, null, null, "");
rptEvents.DataBind();
}
protected void rptEvents_ItemCommand(object source, RepeaterCommandEventArgs e)
{
switch (e.CommandName)
{
case "DeleteEvent":
...
break;
case "EditEvent":
...
break;
}
}