本文介绍了如何修复ASP.NET联系表单提交问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试发送Asp.net联系表单但是当点击提交按钮页面时刷新并且数据未提交。离线联系表格工作正常但在托管网站后它没有提交数据。
如果有人有解决方案请发给我。
非常感谢。
我的尝试:
I am trying to send Asp.net Contact form But when clicking on submit button page is refreshing and data are not submitting. the Contact form offline is working fine but after hosting the website it's not submitting data.
if anyone has a solution please send me.
thanks a lot.
What I have tried:
<div class="col-lg-8 text-white">
Dear visitor is you have any query regarding Our services or Feed Back Please send us.<br>
</div>
<div class="col-lg-4">
<div class="contact-section ">
<div class="container">
<div class="col-md-form-line">
<div class="form-group">
<asp:RequiredFieldValidator ID="RequiredFieldValidatorName" runat="server" ErrorMessage="Name is required" ControlToValidate="txtName" Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtName" runat="server" CssClass="form-control" ToolTip="Enter Name" placeholder="Enter Name"></asp:TextBox>
</div>
<div class="form-group">
<asp:RequiredFieldValidator ID="RequiredFieldValidatorEmail" runat="server" ErrorMessage="Email is required" ControlToValidate="txtEmail" Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidatorEmail" runat="server" ErrorMessage="Please enter a valid email" Text="*" ForeColor="Red" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
<asp:TextBox ID="txtEmail" runat="server" CssClass="form-control" ToolTip="Enter Email" placeholder="Enter Email Id" TextMode="Email"></asp:TextBox>
</div>
<div class="form-group">
<asp:RequiredFieldValidator ID="RequiredFieldValidatorMobileno" runat="server" ErrorMessage="Moble No. is required" ControlToValidate="txtmobileNo" Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtmobileNo" runat="server" CssClass="form-control" ToolTip="Enter Your mobile Number" placeholder="Enter Your mobile Number" TextMode="Phone"></asp:TextBox>
</div>
<div class="form-group">
<asp:RequiredFieldValidator ID="RequiredFieldValidatorsub" runat="server" ErrorMessage="Subject is required" ControlToValidate="txtSubject" Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtSubject" runat="server" CssClass="form-control" ToolTip="Enter Subject" placeholder="Enter Subject"></asp:TextBox>
</div>
<div class="form-group">
<asp:RequiredFieldValidator ID="RequiredFieldValidatorMassage" ControlToValidate="txtMessage" runat="server" ErrorMessage="massage is required" Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtMessage" runat="server" CssClass="form-control" ToolTip="Enter Your Message " placeholder="Start to write Your Message" TextMode="MultiLine" Rows="5"></asp:TextBox>
</div>
<div>
<asp:Button ID="btnsend" runat="server" Text="Send Message" CssClass="btn btn-outline-info" OnClick="btnsend_Click" PostBackUrl="~/Thankyou.aspx"/>
<asp:Label ID="Status" runat="server" Text=""></asp:Label>
<asp:ValidationSummary HeaderText="Please fix the following error" ForeColor="Red" ID="ValidationSummary1" runat="server" BorderWidth="1" BorderColor="Red" />
</div>
</div>
</div>
</div>
</div>
推荐答案
这篇关于如何修复ASP.NET联系表单提交问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!