Newbie question... Executing code when a button is clicked...

Discussion in 'ASP General' started by Brad Pears, Oct 1, 2004.

  1. Brad Pears

    Brad Pears Guest

    Hello there.. I am completely new to ASP and web programming but I do
    program in Acces and VB so know how to program...

    There is a small project involving ASP going on here that I somehow got
    dragged into. SInce I do not know anything abotu it, I downloaded a product
    called ASPRunner which allows you to connect to a DB of choice using an ODBC
    connection and it automatically generates a series of ASP pages which you
    can then run. We have a test web site set up on our IIS server to play
    around with.

    SO, this worked good, but now I want to make some changes like provide data
    editing and be able to add/modify buttons and the code behind them.

    We do not have an ASP product like ASP.net isntalled here and as such have
    used Visual Studio .NET to open one of the ASP pages that were generated by
    ASPRunner.

    Since there is no "form" per se - as compared to what I am used to (it's all
    text in the ASP page) , where do I place code that I want to run when a
    user clicks a button or enters data in a particular field?

    For instance, as a test, I located a line defining buttons in one particular
    ASP page. I then duplicated that line and changed some things and when I ran
    the project - low and behold, there was my new button.

    Now my question is, I want to have something happen when that button is
    clicked - something real simple - like display the user a message that
    "button was clicked".

    Here is a button definition line I added...

    input class=button type=button value="Test" ID="Test1" NAME="Test1"

    How do I reference this in the code somewhere so that when it is clicked,
    the code to display a message will run? Can someone give me some sample
    code and point out how it all works?


    Thanks,

    Brad
     
    Brad Pears, Oct 1, 2004
    #1
    1. Advertisements

  2. Ray Costanzo [MVP], Oct 1, 2004
    #2
    1. Advertisements

  3. Brad Pears

    Brad Pears Guest

    Ray, sorry if I did something wrong. You asked me to start a new thread
    right? Well, that's what I thought I did.. I'm pretty sure I only posted to
    this site. Did I accidentally post elsewhere as well? If I did I;m sorry...
     
    Brad Pears, Oct 4, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.