Html form is not working on a site created by .aspx
I have a similar problem. I use the Form from the website http://www.emailmeform.com/. Here is the code of my form:
<form id="emf-form" target="_blank" enctype="multipart/form-data" method="post" action="http://www.emailmeform.com/builder/form/7Sdql9bTKey" name="emf-form">
<table style="text-align:left;" cellpadding="2" cellspacing="0" border="0" bgcolor="#FFFFFF">
<tr>
<td style="" colspan="2">
<br />
</td>
</tr>
<tr valign="top">
<td id="td_element_label_0" style="" align="right">
<font face="Verdana" size="2" color="#000000"><b>Фамилия</b></font> <span style="color:red;"><small>*</small></span>
</td>
<td id="td_element_field_0" style="">
<input id="element_0" name="element_0" value="" size="20" class="validate[required]" type="text" />
<div style="padding-bottom:8px;color:#000000;"></div>
</td>
</tr>
<tr valign="top">
<td id="td_element_label_1" style="" align="right">
<font face="Verdana" size="2" color="#000000"><b>Имя</b></font> <span style="color:red;"><small>*</small></span>
</td>
<td id="td_element_field_1" style="">
<input id="element_1" name="element_1" value="" size="20" class="validate[required]" type="text" />
<div style="padding-bottom:8px;color:#000000;"></div>
</td>
</tr>
<tr valign="top">
<td id="td_element_label_2" style="" align="right">
<font face="Verdana" size="2" color="#000000"><b>Компания</b></font> <span style="color:red;"><small>*</small></span>
</td>
<td id="td_element_field_2" style="">
<input id="element_2" name="element_2" value="" size="30" class="validate[required]" type="text" />
<div style="padding-bottom:8px;color:#000000;"></div>
</td>
</tr>
<tr valign="top">
<td id="td_element_label_3" style="" align="right">
<font face="Verdana" size="2" color="#000000"><b>Email</b></font> <span style="color:red;"><small>*</small></span>
</td>
<td id="td_element_field_3" style="">
<input id="element_3" name="element_3" value="" size="30" class="validate[required]" type="text" />
<div style="padding-bottom:8px;color:#000000;"></div>
</td>
</tr>
<tr valign="top">
<td id="td_element_label_4" style="" align="right">
<font face="Verdana" size="2" color="#000000"><b>Телефон</b></font> <span style="color:red;"><small>*</small></span>
</td>
<td id="td_element_field_4" style="">
<input id="element_4" name="element_4" value="" size="30" class="validate[required]" type="text" />
<div style="padding-bottom:8px;color:#000000;"></div>
</td>
</tr>
<tr>
<td colspan="2">
<script type="text/javascript">
//<![CDATA[
var RecaptchaOptions = {
theme: 'clean',
custom_theme_widget: 'emf-recaptcha_widget'
};
//]]>
</script> <script type="text/javascript" src="https://ww开发者_如何学Cw.google.com/recaptcha/api/challenge?k=6LchicQSAAAAAGksQmNaDZMw3aQITPqZEsX77lT9">
</script> <noscript><iframe src="https://www.google.com/recaptcha/api/noscript?k=6LchicQSAAAAAGksQmNaDZMw3aQITPqZEsX77lT9" height="300" width="500" frameborder="0"></iframe><br />
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge" /></noscript> <script type="text/javascript">
//<![CDATA[
$(function(){
$('#recaptcha_response_field').addClass('validate[required]');
});
//]]>
</script>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<input name="element_counts" value="5" type="hidden" /> <input name="embed" value="forms" type="hidden" /><input value="Отправить" type="submit" />
</td>
</tr>
</table>
</form>
<div>
<font face="Verdana" size="2" color="#000000">Powered by</font><span style="position: relative; padding-left: 3px; bottom: -5px;"><img src=
"http://www.emailmeform.com/builder/images/footer-logo.png" /></span><font face="Verdana" size="2" color="#000000">EMF</font> <a style="text-decoration:none;" href="http://www.emailmeform.com/"
target="_blank"><font face="Verdana" size="2" color="#000000">Forms Online</font></a>
</div><a style="line-height:20px;font-size:70%;text-decoration:none;" href="http://www.emailmeform.com/report-abuse.html?http://www.emailmeform.com/builder/form/7Sdql9bTKey" target=
"_blank"><font face="Verdana" size="2" color="#000000">Report Abuse</font></a>
The site of origin after I get the error message “Invalid postback or callback argument. Â Event validation is enabled using in configuration or in a page. Â For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. Â If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.”
Site by cms on Bitrix format pages .aspx
What should I do to make this form work? I apologize for my English)
Are you pasting this html form inside your server form? runat="server" You may need to check the html output to confirm that.
The html specification does not permit nested forms. You can have multiple forms on a page, but only one with runat="server" the others need to be plain html forms like the one you posted above and needs to be placed outside the main server form. You can position it with CSS.
Try adding EnableEventValidation="false" to the page directive:
<%@ Page ... EnableEventValidation="false" ...%>
This approach may lower your security, though.
Update I tried your form. I created default web site in Visual Studio 2008. web.config file was one created by VS 2008. I used your code but stripped out script block. Also, the page header was as default:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
That worked for me (except for captcha). At least, form worked:
Since I cannot really replicate your issue, I would suggest trying to make it work on separate web site (locally) first.
精彩评论