asp.net mvc - Using RenderPartial twice for same mvc view control in one page, get problems -
I am using the same partial view in the create.aspx view page, part of my code: & lt; % HTML RenderPartial ("LocationVerifyControl"); %> & Lt;% HTML.RenderPartial ("LocationVerifyControl"); %> In the MVC view user control, there was a button and test code for it: $ ('# btn Verify'). When I clicked the button, I saw the warning dialog twice, the main view page had content with the same IDs (function () {alert ("clicked by btnVerify");} How to solve this type of problems? To prevent the same ID in the main view page, do I use the html ID in the View data and pass them in partial view? If I ask my question Do not understand correctly, you want to add unique functionality to two different buttons with the same ID. Not really valid for being more than one element with the same ID If you have too many, then you should make it a single square, you want to run your markup in advance. Secondly you can do that, you can do a par...