I am working in ASP.net / VB with Access Database.
i have a Multipage in my web site with the Submit button as the last button.
When the Submit button is pressed i want the form values to be added to a
database and sent by email.
1. I have the code which submits the form values to the database. (See at
end)
2. I have the script which sends the email using AspNetMail (See at end)
3. I have the script which detects when the Submit button is pressed:
<script runat="Server">
Sub btnSubmit_Click( s As Object, e As EventArgs )
What should i insert here to add form values to database and after it send to email?
This is basicly the Big Question!
End Sub
</script>
I omit the Next and Previous buttons code.
CODE which inserts form values in database:
(I didn't test it yet but i think everything is allright.)
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO explicador (Field1, Field2, Field3)
VALUES (?, ?, ?)" %>'
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING
_connSite") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABA
SETYPE_connSite") %>'
Expression='<%# Request.Form("MM_insert") = "formValues" %>'
CreateDataSet="false"
Debug="true"
<Parameters>
<Parameter Name="@Field1" Value='<%# IIf((Request.Form("Field1") <>
Nothing), Request.Form("Field1"), "") %>' Type="WChar" />
<Parameter Name="@Field2" Value='<%# IIf((Request.Form("Field2") <>
Nothing), Request.Form("Field2"), "") %>' Type="WChar" />
<Parameter Name="@Field3" Value='<%# IIf((Request.Form("Field3") <>
Nothing), Request.Form("Field3"), "") %>' Type="WChar" />
</Parameters>
</MM:Insert>
Script which sends form values using AspNetEmail:
<script runat="server">
Private Sub sendEmail(sender as Object, e as System.EventArgs)
I omit the code as it to extensive but it's working as i used it many
times...
End Sub
</script>
Thank You Very Much,
Miguel