I'm using same partial view in create.aspx view page twice, part of my code is: <%Html.RenderPartial("LocationVerifyControl"); %> <%Html.RenderPartial("LocationVerifyControl"); %>
In the mvc view user controls, it had a button and test code for it: $('#btnVerify').click(function() { alert("clicked by btnVerify");}
I watched the warning dialog pop up twice when clicked the button, the main view page had contents with same ids. How to solve this kind of problems? To prevent same ids in main view page, put my using html ids in the view data and pass them to partial view?