I am busy doing a small application to get myself familiar with asp.net, and I have run into a problem. I have a list of anchors created with a repeater. I need to uniquely identify each anchor when doing a post back so that some data fields can be filled with the appropriate data. I have tried setting the id as follows:
<a href="#" id='<%#GetPhotoKey(Container.DataItem)%>' onserverclick='SelectAnchor_Click' runat="server"><%#GetPhotoTitle(Container.DataItem )%></a>
I get an "invalid identifier" error with the above code. Setting the name this way results in the server-side script being sent to the client.
The only other option I can think of is to reload the page (via the querystring). This brings up an entirely different problem that I would like to avoid if at all possible.
Any help would be greatly appreciated.