I need to generate unique identifiers for html elements in asp.net mvc application. In classic asp.net i could use
%>
There is no single solution to this.
You need to modify your code to generate IDs based on whatever is generating the elements.
For example, if you're looping over rows from a database, you can use the rows' primary keys to generate IDs.
Alternatively, you can eschew IDs altogether and use non-unique classes. (this is especially convenient with jQuery and descendant selectors)