By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

How to run this when the button is pressed?

P: n/a
Hello,

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
Nov 18 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
someString = yourTextbox.Text
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
Hello,

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

Nov 18 '05 #2

P: n/a
Sorry, but i got completly lost by your answer.
I didn't understand how that can run the insert data to database code and
after it the send data by email.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:eX**************@TK2MSFTNGP09.phx.gbl...
someString = yourTextbox.Text
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
Hello,

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


Nov 18 '05 #3

P: n/a
it was to show you how to retrieve the form values....isnt' that where you
were stuck?
You said you knew how to insert and send the e-mail.....
Or am I missing something here?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...
Sorry, but i got completly lost by your answer.
I didn't understand how that can run the insert data to database code and
after it the send data by email.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:eX**************@TK2MSFTNGP09.phx.gbl...
someString = yourTextbox.Text
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
Hello,

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



Nov 18 '05 #4

P: n/a
No. The strange thing is i know all that. I just don't know how to give the
order to make all that work when i click the last button of the multipage.

Usually to send the form values using the email i give the order in the
button:
<asp:Button ID="send" runat="server" OnClick="sendEmail" Text="Send"
Width="160" />

And to insert values in database i put this code in the end of the form:
<input type="hidden" name="MM_insert" value="dadosForm">

My problem is how to make both things run when the last button on the
Multipage is pressed.

The script i have for this button is:

<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

Thanks,
Miguel

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:uQ**************@tk2msftngp13.phx.gbl...
it was to show you how to retrieve the form values....isnt' that where you
were stuck?
You said you knew how to insert and send the e-mail.....
Or am I missing something here?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...
Sorry, but i got completly lost by your answer.
I didn't understand how that can run the insert data to database code and after it the send data by email.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:eX**************@TK2MSFTNGP09.phx.gbl...
someString = yourTextbox.Text
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
> Hello,
>
> 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
>
>



Nov 18 '05 #5

P: n/a
BTW, could you check your computer's clock and/or time zone setting?

"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
No. The strange thing is i know all that. I just don't know how to give
the
order to make all that work when i click the last button of the multipage.

Usually to send the form values using the email i give the order in the
button:
<asp:Button ID="send" runat="server" OnClick="sendEmail" Text="Send"
Width="160" />

And to insert values in database i put this code in the end of the form:
<input type="hidden" name="MM_insert" value="dadosForm">

My problem is how to make both things run when the last button on the
Multipage is pressed.


Nov 18 '05 #6

P: n/a
Oops. You did fix it. Sorry.

"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
No. The strange thing is i know all that. I just don't know how to give
the
order to make all that work when i click the last button of the multipage.

Usually to send the form values using the email i give the order in the
button:
<asp:Button ID="send" runat="server" OnClick="sendEmail" Text="Send"
Width="160" />


Nov 18 '05 #7

P: n/a
private void SendMail()
{
....code here
}
private void WriteToDB()
{
....code here
}

And then in the Click event
{
SendMail();
WriteToDB();
}

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
No. The strange thing is i know all that. I just don't know how to give the order to make all that work when i click the last button of the multipage.

Usually to send the form values using the email i give the order in the
button:
<asp:Button ID="send" runat="server" OnClick="sendEmail" Text="Send"
Width="160" />

And to insert values in database i put this code in the end of the form:
<input type="hidden" name="MM_insert" value="dadosForm">

My problem is how to make both things run when the last button on the
Multipage is pressed.

The script i have for this button is:

<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

Thanks,
Miguel

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:uQ**************@tk2msftngp13.phx.gbl...
it was to show you how to retrieve the form values....isnt' that where you
were stuck?
You said you knew how to insert and send the e-mail.....
Or am I missing something here?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...
Sorry, but i got completly lost by your answer.
I didn't understand how that can run the insert data to database code and after it the send data by email.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:eX**************@TK2MSFTNGP09.phx.gbl...
> someString = yourTextbox.Text
>
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
>
> "Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
> news:uc**************@TK2MSFTNGP09.phx.gbl...
> > Hello,
> >
> > 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
> >
> >
>
>



Nov 18 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.