This might seem like a strange question, and perhaps I am not thinking about it in the right way, but I am looking for some help.
Let’s say I have a list of objects with an ID and a Name. We don’t want the users to see the ID, it is private. I bind this list to a repeater control using only the name attribute, so there are a bunch of textboxes with the Names in them on the page.
The user then changes a Name, and saves it. Now, we NEED the ID in order to save changes, or else we can’t figure out which name is the original! But if it is not saved in our textbox upon binding, it is lost. What is a safe way to keep it in the control, so that when I call the OnTextChanged event I can use it?
tl;dr: how can I store an ID in each textbox control to access it later without the user seeing that ID?
Edit: I realize one possible solution is to find the ID again on the OnTextChanged event, before the name is changed, but in this particular scenario the ID needs to be accessed outside of the OnTextChanged event.
use a hidden field to store the id. it’s not visible when viewing the data in the browser, but it is visible if the user views the html markup. but there isn’t a way around that. that’s the nature of the web.