-
Feb 20th, 2012, 04:31 AM
#1
Thread Starter
New Member
Form doesn't submit in IE9
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:
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>
I replaced some mailadresses to a imaginary one.
-
Feb 20th, 2012, 06:14 AM
#2
Re: Form doesn't submit in IE9
Welcome to the forums!
Since you're working with WebForms, I moved your thread to the ASP.NET section.
-
Feb 20th, 2012, 06:25 AM
#3
Thread Starter
New Member
Re: Form doesn't submit in IE9
Ok, tnx. Tha's how fresh i am
-
Feb 21st, 2012, 03:06 AM
#4
Re: Form doesn't submit in IE9
Hello,
When you say it doesn't submit, are you saying that none of your server side code runs? Have you placed a breakpoint on the server side code, and confirmed that the breakpoint isn't hit?
Also, are there any client side errors occuring? In IE9 you can confirm this hitting F12 and using the Developer Tools to look at the Console tab when you are trying to submit the page.
Gary
-
Feb 23rd, 2012, 03:48 AM
#5
Thread Starter
New Member
Re: Form doesn't submit in IE9
Tnx for your reply.
The code i pasted above is all i have. Never heard of a breakpoint.
BUT...
Oddly enough i tried the Developer Tools by hitting F12, pressed submit and the form was processed and send. I can't remember changing anything to the code
-
Feb 23rd, 2012, 07:36 AM
#6
Re: Form doesn't submit in IE9
Hello,
Glad to hear that you got it working.
Simply enabling the Developer Tools shouldn't affect the processing of your code, so I think something must have changed. I take it when you run the code without F12, it is still working? Correct?
In terms of getting started with debugging, and breakpoints, I would suggest that you take a look here:
http://msdn.microsoft.com/en-us/libr...(v=vs.71).aspx
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|