ASP.NET MVC 2 Input ID
Adding the following to my view:
<input type=开发者_开发知识库"text" runat="server" id="newBookingRef" name="newBookingRef" />
Results in the following HTML:
<input type="text" id="MainContent_newBookingRef" name="ctl00$MainContent$newBookingRef">
If I use the helper method Html.Textbox, the ID is generated as I would expect "newBookingRef".
How can I stop it prefixing the ID on standard input controls with the content placeholder id? I tried playing with the ClientIdMode of the content placeholder but this didn't seem to help.
Thanks, Ben
Remove the runat="server" attribute.
精彩评论