开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜