473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to run this when the button is pressed?

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 20 '05 #1
1 1269
Hi Miquel,

This is so hard for us to answer, most of us are using compiled VB.net.

You are using aspx vb.net script. That is some different writting.
Than by most visitors in this newsgroup.

However in this newsgroup it is normal and you have all functions I
understand the only problem is how to write them right on your pages. Maybe
you can ask it in this newsgroup.

Microsoft.public.dotnet.framework.aspnet

By the way that dropdownlist sample with the dates what I made yesterday for
you was that what you needed?

Cor

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jb | last post by:
Hello, I need to know which button was pressed in the submit , i tried reading the vaule of submit it the validateDate function but it returns 'undefined' value ; I do this in asp all the time, Not...
7
by: Miguel Dias Moura | last post by:
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...
3
by: Mel | last post by:
Hi, Is there any way I can force to change button background colour when toggle button is checked? Just like button change its background colour when mouseover in MS Visual Studio.NET. I hope I...
19
by: darrel | last post by:
On my vb.net page, I have 4 sets of inputs + form buttons. example: Search: (GO) Zip: (GO) County: (GO) County: (GO) The problem is if I go to the page, type in a zip code, and hit...
2
by: matthewr | last post by:
In Internet Explorer, for example, when you hit return in the address bar, the Go button is pressed. In my program, I have a toolstrip with a textbox and button. How do I ensure the button is...
1
by: Ed Sutton | last post by:
<Newbie> How can I get arguments, and build a query URL, before a button is pressed? I have a text box to enter a serial number. When the search button is pressed, I wish append the serial...
3
by: noddy | last post by:
I have a button <input type="button" value="Get data"> When it is clicked a database is accessed and the data is eventually displayed on the screen. While the data is being retrieved the...
2
by: Max2006 | last post by:
Hi, I have a simple form with a button on it. After a button click postback, anytime user press F5 (browser page refresh), the button's OnClick event handler is called again without the button...
1
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
4
by: 200dogz | last post by:
Hi guys, Just a quick and simple question: i'm trying to have a loading image displayed when a submit button is pressed. Basically what I have at this stage is an asp:image with its...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.