Results 1 to 2 of 2

Thread: executing a certain bit of code

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    executing a certain bit of code

    Hi,

    how can i execute a certain bit of code when the submit button is pressed? What i want to do is put the data in text boxes into a database record when the submit button is presses.....but i need to do it on the same page, instead of passing the variables to another.

    Thanks for any help
    Nick

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Hi,
    Personally i think its better if you use two pagesas you can then seperate the HTML and asp code. It becomes much more manageable.

    You can do it using one page, but the code becomes hard to read and thus hard to debug when you have errors. Also you can let the web designer mess around with the laout(HTML) without interfearing with your asp code if u keep the page seperate.

    To do it in the same page use parameter to decide if the user has submitted the form.

    eg
    if submitted=true then
    'code to add to the database
    else
    'display the form
    'and other html code
    end if


    Danial
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width