I'm quite fresh when it comes to VB.NET an i tried to make a form. Submits very nice in IE8, FF and Chrome, but IE9 fails to submit it.
I would appreciate it when someone can take a look and address where i am making a mistake.
The code i have:
I replaced some mailadresses to a imaginary one.Code:<%@ Page Language="VB" Debug="true" %> <% @Import Namespace="System.Web.Mail" %> <% @Import Namespace="System.IO" %> <script language="vb" runat="server"> Sub Send2Mail (sender as Object, e as EventArgs) Dim objMail as New MailMessage() Dim myMessage As MailMessage Dim i, iCnt As Integer objMail.To = "me@domain.nl" objMail.From = strEmaildocent.Text objMail.BodyFormat = MailFormat.Text objMail.Priority = MailPriority.Normal objMail.Subject = strOnderwerpwerkstuk.Text objMail.Body = "Naam begeleidend docent: " + strNaamdocent.Text + vbNewLine + "Email begeleidend docent : " + strEmaildocent.text + vbnewLine + "Naam leerling 1 : " + strNaamleerling1.text + vbnewLine + "Naam leerling 2 : " + strNaamleerling2.text + vbnewLine + "Naam leerling 3 : " + strNaamleerling3.text + vbnewLine + "School : " + strSchool.Text + vbnewLine + "Profiel : " + strProfiel.text + vbnewLine + "Titel profielwerkstuk : " + strTitelwerkstuk.text + vbnewLine + "Onderwerp profielwerkstuk : " + strOnderwerpwerkstuk.text + vbnewLine + "Korte samenvatting : " + strSamenvatting.text + vbnewLine + "Aantal bijlagen : " + strAantalbijlagen.text + vbnewLine SmtpMail.SmtpServer = "smtp.provider.nl" SmtpMail.Send(objMail) strMessage.Visible = true strForm.Visible = false End Sub </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Inschrijfformulier Carmel Award</title> <link rel="STYLESHEET" type="text/css" href="css/base.css" /> <link rel="STYLESHEET" type="text/css" href="css/form.css" /> </head> <body><p> <asp:panel id="strMessage" runat="server" Visible="False"> <font color="green"><b>Bedankt voor uw inzending, half mei ontvangt de begeleidend docent via e-mail nadere informatie.</b></font><br> <font color="red"><b>Vergeet niet de profielwerkstukken per e-mail (of <a href="http://www.wetransfer.com">wetransfer.com</a>) naar <a href="mailto:me@domain.nl">me@domain.nl</a> te sturen.</b></font></asp:panel> <asp:panel id="strForm" runat="server" Visible="True" ></p> <p><form runat="server"> <table> <tr> <td>Naam begeleidend docent:</td> <td> <asp:textbox id="strNaamdocent" runat="server" /> <asp:RequiredFieldValidator ID="req1" runat="server" ControlToValidate="strNaamdocent" Text="Vul hier de naam in." /> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="" ControlToValidate="strNaamdocent" ValidationExpression="^[a-zA-Z''-'\s]{1,40}$" /> </td> </tr> <tr> <td>E-mailadres begeleidend docent:</td> <td> <asp:textbox id="strEmaildocent" runat="server" /> <asp:RequiredFieldValidator ID="req2" runat="server" ControlToValidate="strEmaildocent" Text="Vul hier het e-mailadres in." /> <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="vb. jouwnaam@school.nl" ControlToValidate="strEmaildocent" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" /> </td> </tr> <tr> <td>Naam leerling 1:</td> <td> <asp:textbox id="strNaamleerling1" runat="server" /> <asp:RequiredFieldValidator ID="req3" runat="server" ControlToValidate="strNaamleerling1" Text="Vul hier de naam in." /> <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="" ControlToValidate="strNaamleerling1" ValidationExpression="^[a-zA-Z''-'\s]{1,40}$" /> </td> </tr> <tr> <td>Naam leerling 2:</td> <td> <asp:textbox id="strNaamleerling2" runat="server" /> </td> </tr> <tr> <td>Naam leerling 3:</td> <td> <asp:textbox id="strNaamleerling3" runat="server" /> </td> </tr> <tr> <td>School:</td> <td> <asp:DropDownList id="strSchool" runat="server"> <asp:ListItem Value="">Selecteer een school</asp:ListItem> <asp:ListItem>Bonhoeffer College, Bruggertstraat</asp:ListItem> <asp:ListItem>Bonhoeffer College, Geessinkweg</asp:ListItem> <asp:ListItem>Bonhoeffer College, Van der Waalslaan</asp:ListItem> <asp:ListItem>Carmelcollege Emmen</asp:ListItem> <asp:ListItem>Carmel College Salland, Hofstedelaan</asp:ListItem> <asp:ListItem>Etty Hillesum Lyceum, Het Vlier</asp:ListItem> <asp:ListItem>Het Hooghuis, TBL</asp:ListItem> <asp:ListItem>Maartenscollege, Hemmenlaan</asp:ListItem> <asp:ListItem>Maartenscollege, Internationale school</asp:ListItem> <asp:ListItem>Pius X College, Aalderinkshoek</asp:ListItem> <asp:ListItem>Carmelcollege Gouda, Antoniuscollege</asp:ListItem> <asp:ListItem>Sg. Augustinianum</asp:ListItem> <asp:ListItem>Sg. De Grundel, Lyceum de Grundel</asp:ListItem> <asp:ListItem>Sg. Marianum, Groenlo</asp:ListItem> <asp:ListItem>Sg. St- Canisius, Slot</asp:ListItem> <asp:ListItem>Sg. Twickel, Woolderesweg</asp:ListItem> <asp:ListItem>Twents Carmel College, De Thij</asp:ListItem> <asp:ListItem>Twents Carmel College, Lyceumstraat</asp:ListItem> </asp:DropDownList> <asp:RequiredFieldValidator ID="req4" runat="server" ControlToValidate="strSchool" Text="Selecteer een school" /> </td> </tr> <tr> <td>Profiel:</td> <td> <asp:DropDownList id="strProfiel" runat="server"> <asp:ListItem Value="">Selecteer een profiel</asp:ListItem> <asp:ListItem>havo - natuur & techniek</asp:ListItem> <asp:ListItem>havo - natuur & gezondheid</asp:ListItem> <asp:ListItem>havo - economie & maatschappij</asp:ListItem> <asp:ListItem>havo - cultuur & maatschappij</asp:ListItem> <asp:ListItem>vwo - natuur & techniek</asp:ListItem> <asp:ListItem>vwo - natuur & gezondheid</asp:ListItem> <asp:ListItem>vwo - economie & maatschappij</asp:ListItem> <asp:ListItem>vwo - cultuur & maatschappij</asp:ListItem> </asp:DropDownList> <asp:RequiredFieldValidator ID="req5" runat="server" ControlToValidate="strProfiel" Text="Selecteer een profiel" /> </td> </tr> <tr> <td>Titel profielwerkstuk:</td> <td> <asp:textbox id="strTitelwerkstuk" runat="server" /> <asp:RequiredFieldValidator ID="req6" runat="server" ControlToValidate="strTitelwerkstuk" Text="Vul hier de titel in." /> </td> </tr> <tr> <td>Onderwerp profielwerkstuk:</td> <td> <asp:textbox id="strOnderwerpwerkstuk" runat="server" /> <asp:RequiredFieldValidator ID="req7" runat="server" ControlToValidate="strOnderwerpwerkstuk" Text="Vul hier het onderwerp in." /> <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" ErrorMessage="" ControlToValidate="strOnderwerpwerkstuk" ValidationExpression="^[a-zA-Z''-'\s]{1,40}$" /> </td> </tr> <tr> <td>Korte samenvatting:</td> <td> <asp:textbox id="strSamenvatting" runat="server" Columns="45" Rows="10" TextMode="MultiLine" /> <asp:RequiredFieldValidator ID="req8" runat="server" ControlToValidate="strSamenvatting" Text="Vul hier de korte samenvatting in." /> <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" ErrorMessage="" ControlToValidate="strSamenvatting" ValidationExpression="^[a-zA-Z''-'\s]{1,40}$" /> </td> </tr> <tr> <td>Aantal bijlagen:</td> <td> <asp:textbox id="strAantalbijlagen" runat="server" /><br /> <asp:RequiredFieldValidator ID="req9" runat="server" ControlToValidate="strAantalbijlagen" Text="Vul hier het aantal bijlagen in die het werkstuk groot is." /> <asp:RegularExpressionValidator ID="RegularExpressionValidator9" runat="server" ErrorMessage="Vul een getal in" ControlToValidate="strAantalbijlagen" ValidationExpression="^\d+$" /> </td> </tr> <tr> <td colspan="2"><br />NB: alle velden zijn verplicht om in te vullen, behalve naam leerling 2 en naam leerling 3<br /> <font color="red"><b>Stuur uw profielwerkstukken per e-mail (of wetransfer.com) naar <a href="mailto:me@domain.nl">me@domain.nl</a></b></font><br /> Indien het formulier niet lijkt te werken, probeer dan de compatibiliteitsmodus. We hebben het probleem in onderzoek. Onze excuses voor het ongemak.</td> </tr> <tr> <td></td> <td> <asp:button runat="server" id="func" Text="Stuur bericht" OnClick="Send2Mail" /> </td> </tr> </table> </form></p></asp:panel> </body> </html>


Reply With Quote

