【发布时间】:2011-08-13 03:11:27
【问题描述】:
在我的表单中,我需要插入“文本”类型的不同输入。输入必须是带有名称和 ID 的 html 控件。因为我将此表单发送到外部 url。
对于验证,我在所有输入中执行 runat=server,然后我可以使用 requiredfieldvalidator。
但问题是当我在访问页面后查看源代码时,名称和 ID 都已更改。 例如
<input id="first_name" class="formright" type="text" name="first_name" runat="server" />
改成
<input name="ctl00$cphContent$first_name" type="text" id="ctl00_cphContent_first_name" class="formright">
我必须使用 html 控件,因为外部 postbackurl 会查看名称和 id 值来查找控件。所以我不能使用asp控件。正因为如此,我使用了带有 runat=server 的 html 控件
感谢您的帮助
【问题讨论】:
标签: .net asp.net validation forms