Using a href onclick in asp 3.0 page

Discussion in 'ASP General' started by Ellie, Sep 15, 2008.

  1. Ellie

    Ellie Guest

    I am trying to cancel a href by coding onclick="return false" in my page. I
    can put in a function and have a test "alert" box come up but the "return
    false" never works no matter what I try. Is there a problem with that and
    asp? Thanks
    Ellie, Sep 15, 2008
    #1
    1. Advertising

  2. "Ellie" <> wrote in message
    news:...
    >I am trying to cancel a href by coding onclick="return false" in my page. I
    >can put in a function and have a test "alert" box come up but the "return
    >false" never works no matter what I try. Is there a problem with that and
    >asp? Thanks


    Hi Ellie,

    You'd have to explain more clearly what you are doing,...but click events
    are Client-Side (runs on the user's machine) and ASP runs on the Server-Side
    (runs on the web server), and the two never really see or are aware of each
    other. So it is really unrelated to ASP Classic. ASP has already finished
    running (and has stopped/completed) before the user ever sees anything in
    their browser,...by the same token the server never sees anything the user
    does until the browser sends a new request containing a new URL with Post or
    Querystring data back to the server.

    There may still be someone around here that might answer it, but your best
    bet is tro ask in one of the regular (non-ASP) Scripting Groups that pertain
    the Web Developement.

    --
    Phillip Windell
    www.wandtv.com

    The views expressed, are my own and not those of my employer, or Microsoft,
    or anyone else associated with me, including my cats.
    -----------------------------------------------------
    Phillip Windell, Sep 15, 2008
    #2
    1. Advertising

  3. Looking over the group list, this one may be a good one, but there may be
    others.

    microsoft.public.inetexplorer.scripting


    --
    Phillip Windell
    www.wandtv.com

    The views expressed, are my own and not those of my employer, or Microsoft,
    or anyone else associated with me, including my cats.
    -----------------------------------------------------
    Phillip Windell, Sep 15, 2008
    #3
  4. Ellie

    Old Pedant Guest

    "Ellie" wrote:

    > I am trying to cancel a href by coding onclick="return false" in my page. I
    > can put in a function and have a test "alert" box come up but the "return
    > false" never works no matter what I try. Is there a problem with that and
    > asp? Thanks


    AHA! I saw the posting in the MSIE newsgroup and replied. But now that I
    see you are doing this in ASP.NET, I'll bet I know the answer!

    If you are using an ASP.NET control (e.g., an <asp:linkbutton>), instead of
    an ordinary <A HREF=...>, then you probably need to use onClientClick instead
    of just onClick.
    Old Pedant, Sep 15, 2008
    #4
  5. Old wrote on Mon, 15 Sep 2008 13:40:02 -0700:



    > "Ellie" wrote:


    >> I am trying to cancel a href by coding onclick="return false" in my
    >> page. I can put in a function and have a test "alert" box come up
    >> but the "return false" never works no matter what I try. Is there a
    >> problem with that and asp? Thanks


    > AHA! I saw the posting in the MSIE newsgroup and replied. But now
    > that I see you are doing this in ASP.NET, I'll bet I know the answer!


    > If you are using an ASP.NET control (e.g., an <asp:linkbutton>),
    > instead of an ordinary <A HREF=...>, then you probably need to use
    > onClientClick instead of just onClick.



    Where is ASP.NET mentioned? The subject says ASP 3.0 - that's the current
    version of classic ASP.

    --
    Dan
    Daniel Crichton, Sep 16, 2008
    #5
  6. "Daniel Crichton" <> wrote in message
    news:uf%23%23aR$...
    > Old wrote on Mon, 15 Sep 2008 13:40:02 -0700:
    >
    >
    >
    >> "Ellie" wrote:

    >
    > >> I am trying to cancel a href by coding onclick="return false" in my
    > >> page. I can put in a function and have a test "alert" box come up
    > >> but the "return false" never works no matter what I try. Is there a
    > >> problem with that and asp? Thanks

    >
    >> AHA! I saw the posting in the MSIE newsgroup and replied. But now
    >> that I see you are doing this in ASP.NET, I'll bet I know the answer!

    >
    >> If you are using an ASP.NET control (e.g., an <asp:linkbutton>),
    >> instead of an ordinary <A HREF=...>, then you probably need to use
    >> onClientClick instead of just onClick.

    >
    >
    > Where is ASP.NET mentioned? The subject says ASP 3.0 - that's the current
    > version of classic ASP.


    When you look futher to that actual issue being decribed it is Client side
    Scripting that is running in the user's browser,...so it is not even ASP at
    all of any kind.

    --
    Phillip Windell
    www.wandtv.com

    The views expressed, are my own and not those of my employer, or Microsoft,
    or anyone else associated with me, including my cats.
    -----------------------------------------------------
    Phillip Windell, Sep 16, 2008
    #6
  7. Daniel Crichton wrote:
    > Old wrote on Mon, 15 Sep 2008 13:40:02 -0700:
    >
    >
    >
    >> "Ellie" wrote:

    >
    > >> I am trying to cancel a href by coding onclick="return false" in

    > my >> page. I can put in a function and have a test "alert" box
    > come up >> but the "return false" never works no matter what I try.
    > Is there a >> problem with that and asp? Thanks
    >
    >> AHA! I saw the posting in the MSIE newsgroup and replied. But now
    >> that I see you are doing this in ASP.NET, I'll bet I know the
    >> answer!

    >
    >> If you are using an ASP.NET control (e.g., an <asp:linkbutton>),
    >> instead of an ordinary <A HREF=...>, then you probably need to use
    >> onClientClick instead of just onClick.

    >
    >
    > Where is ASP.NET mentioned?


    It must have been in the other group where this was posted.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Sep 16, 2008
    #7
  8. Ellie

    Ellie Guest

    Inasmuch as I love a good "AHA", sadly, I am using ASP 3.0 and wrote in the
    other group that I have found other people on the internet that are having
    similar problems with Vista and IE7 (I bet I didn't mention that!).

    This is what I wrote in the inetexplorer.scripting thread:

    I found this and many other web sites:

    http://11heavens.com/IE7-bug-report-onclick-event-handler

    It isn't necessary that I use this since I came up with my workaround. I
    have Vista (I want to stay current even if it kills me) and IE7 so I'm just
    putting this down as "it just doesn't work for me". Thanks


    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > Daniel Crichton wrote:
    >> Old wrote on Mon, 15 Sep 2008 13:40:02 -0700:
    >>
    >>
    >>
    >>> "Ellie" wrote:

    >>
    >> >> I am trying to cancel a href by coding onclick="return false" in

    >> my >> page. I can put in a function and have a test "alert" box
    >> come up >> but the "return false" never works no matter what I try.
    >> Is there a >> problem with that and asp? Thanks
    >>
    >>> AHA! I saw the posting in the MSIE newsgroup and replied. But now
    >>> that I see you are doing this in ASP.NET, I'll bet I know the
    >>> answer!

    >>
    >>> If you are using an ASP.NET control (e.g., an <asp:linkbutton>),
    >>> instead of an ordinary <A HREF=...>, then you probably need to use
    >>> onClientClick instead of just onClick.

    >>
    >>
    >> Where is ASP.NET mentioned?

    >
    > It must have been in the other group where this was posted.
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    Ellie, Sep 16, 2008
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CRON
    Replies:
    24
    Views:
    200,722
    Adrienne Boswell
    Jun 20, 2006
  2. Replies:
    2
    Views:
    466
  3. VA

    Overriding a href using onClick

    VA, Oct 31, 2005, in forum: Javascript
    Replies:
    5
    Views:
    244
    Mick White
    Oct 31, 2005
  4. Vincent van Beveren

    BASE HREF and A HREF="#" onclick="..."

    Vincent van Beveren, Jul 6, 2006, in forum: Javascript
    Replies:
    2
    Views:
    316
    Vincent van Beveren
    Jul 6, 2006
  5. kelvlam
    Replies:
    6
    Views:
    342
    kelvlam
    Jul 18, 2006
Loading...

Share This Page