Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Using Buttons


Message #1 by "Noumaan Abubakar" <noumaan_abubakar@m...> on Thu, 31 May 2001 10:15:58
Hello can anyone help me...



I need to put code behind a button so that when it is clicked it executes 

code which adds a record to a database. I have no idea how to achieve 

this, I don't know which type of button to use whether I should use submit 

type or button type, also do I have to use a form??



I have got the code to add a record successfully, all I need to do is 

invoke that code when the button is clicked.



Thankyou in advance



Noumaan



Message #2 by "Daniel O'Dorisio" <dodorisio@h...> on Thu, 31 May 2001 14:26:09 -0400
k. i would put all your elements inside a form tag with the action as a

second page and method as post.. for ease of development. then add a submit

button.

when the button is clicked it will go to the second page. you can use just

asp.. no HTML and use your code for insertind a record. the way to access

the data from the form is:

Request.Form("<elementname>")



and then once you have added it you can redirect to a page that says

congrats!!



daniel



Daniel O'Dorisio

dodorisio@h...

xxx-xxx-xxxx





-----Original Message-----

From: Noumaan Abubakar [mailto:noumaan_abubakar@m...]

Sent: Thursday, May 31, 2001 10:16 AM

To: ASP Databases

Subject: [asp_databases] Using Buttons





Hello can anyone help me...



I need to put code behind a button so that when it is clicked it executes

code which adds a record to a database. I have no idea how to achieve

this, I don't know which type of button to use whether I should use submit

type or button type, also do I have to use a form??



I have got the code to add a record successfully, all I need to do is

invoke that code when the button is clicked.



Thankyou in advance



Noumaan



Message #3 by Greg Griffiths <griffiths@x...> on Thu, 31 May 2001 21:22:11 +0100
You'll definitely need a button, and as you are going to need to do this on



the server side, it may as well be a SUBMIT button, which needs to be

included in a HTML form which will then pass the variables onto your ASP

which you will then use to put the data into the database.



At 10:15 31/05/01 +0000, you wrote:

>Hello can anyone help me...

>

>I need to put code behind a button so that when it is clicked it executes

>code which adds a record to a database. I have no idea how to achieve

>this, I don't know which type of button to use whether I should use submit

>type or button type, also do I have to use a form??

>

>I have got the code to add a record successfully, all I need to do is

>invoke that code when the button is clicked.

>

>Thankyou in advance

>

>Noumaan




  Return to Index