My URL length is capped at 2084 characters and I have forms that need to have essay’s emailed. I am not using MVC, not sure if that matters. Forms are set to POST data, runat=server. I just want the code behind the main page to load and send an email, I don’t need all the variables passed in the URL. Is this possible or does ASP.net just fill up the URL with VIEWSTATE data? If so, how can I send an email with this data without it going in the url?
Oh I also edited the web.config to allow a larger maxQueryStringLength but from what I am reading older browsers don’t really support that anyway.
<form id="infoForm" runat="server" name="contactForm" method="POST" action="#">
<!--Other form stuff here-->
<asp:Button class="button" id="submitButton" Text="Submit" runat="server"
onclick="submitButton_Click" />
</form>
If you are sending an email you don’t need to send the data via the URL. You just send an e-mail using
System.Net.Mailand your form data goes into the e-mail.Code sample below: