Using a href onclick in asp 3.0 page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ellie

    Using a href onclick in asp 3.0 page

    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

  • Phillip Windell

    #2
    Re: Using a href onclick in asp 3.0 page

    "Ellie" <ellymay999nosp am@nospamnetzer o.comwrote in message
    news:OukJZp1FJH A.4460@TK2MSFTN GP06.phx.gbl...
    >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


    The views expressed, are my own and not those of my employer, or Microsoft,
    or anyone else associated with me, including my cats.
    -----------------------------------------------------


    Comment

    • Phillip Windell

      #3
      Re: Using a href onclick in asp 3.0 page

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

      microsoft.publi c.inetexplorer. scripting


      --
      Phillip Windell


      The views expressed, are my own and not those of my employer, or Microsoft,
      or anyone else associated with me, including my cats.
      -----------------------------------------------------


      Comment

      • =?Utf-8?B?T2xkIFBlZGFudA==?=

        #4
        RE: Using a href onclick in asp 3.0 page



        "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.

        Comment

        • Daniel Crichton

          #5
          Re: Using a href onclick in asp 3.0 page

          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


          Comment

          • Phillip Windell

            #6
            Re: Using a href onclick in asp 3.0 page

            "Daniel Crichton" <msnews@worldof spack.comwrote in message
            news:uf%23%23aR $FJHA.5252@TK2M SFTNGP04.phx.gb l...
            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
            >onClientClic k 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


            The views expressed, are my own and not those of my employer, or Microsoft,
            or anyone else associated with me, including my cats.
            -----------------------------------------------------


            Comment

            • Bob Barrows [MVP]

              #7
              Re: Using a href onclick in asp 3.0 page

              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
              >onClientClic k 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.


              Comment

              • Ellie

                #8
                Re: Using a href onclick in asp 3.0 page

                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.sc ripting thread:

                I found this and many other web sites:

                In Internet Explorer 7 (final release, build 7.0.5730.11), we cannot, using Javascript, cancel the browser’s default action for an anchor element by setting this element’s onclick event-handler to false. One way to solve the problem is to remove the


                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]" <reb01501@NOyah oo.SPAMcomwrote in message
                news:e8ADIHAGJH A.3408@TK2MSFTN GP04.phx.gbl...
                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
                >>onClientCli ck 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.
                >
                >

                Comment

                Working...