Calling html link from a button?

Discussion in 'ASP General' started by Sean M. Loftus, Nov 17, 2005.

  1. I have a need to call an html page into the pane I'm viewing using a button
    on an ASP page. The page itself is an ASP page called from a website. I know
    a link would work but the rest of the page has buttons and it would look
    cleaner to use a button.

    I've tried the below in a few variations, including using a href tags inside
    the onclick. Anyone have a suggestion on what I'm doing wrong here?

    <input type="button" value="<%=L_MBS_Text%>"
    onclick="get(https://domain.com/size/")>

    --
    Sean M. Loftus
    Enterprise Architect
    Loftus Consulting, Inc.
    www.LoftusConsulting.com
    sean(removeme)@loftus.org
     
    Sean M. Loftus, Nov 17, 2005
    #1
    1. Advertising

  2. Sean M. Loftus

    McKirahan Guest

    "Sean M. Loftus" <sean(remove me)@loftus.org> wrote in message
    news:...
    > I have a need to call an html page into the pane I'm viewing using a

    button
    > on an ASP page. The page itself is an ASP page called from a website. I

    know
    > a link would work but the rest of the page has buttons and it would look
    > cleaner to use a button.
    >
    > I've tried the below in a few variations, including using a href tags

    inside
    > the onclick. Anyone have a suggestion on what I'm doing wrong here?
    >
    > <input type="button" value="<%=L_MBS_Text%>"
    > onclick="get(https://domain.com/size/")>
    >
    > --
    > Sean M. Loftus
    > Enterprise Architect
    > Loftus Consulting, Inc.
    > www.LoftusConsulting.com
    > sean(removeme)@loftus.org


    You did not show us your get() function.

    Perhaps all you want is this:

    <input type="button" value="<%=L_MBS_Text%>"
    onclick="location.href='https://domain.com/size/'">
     
    McKirahan, Nov 17, 2005
    #2
    1. Advertising

  3. Sean M. Loftus wrote:
    > I have a need to call an html page into the pane I'm viewing using a
    > button on an ASP page.


    This is not an ASP problem (you could be trying to do the same with a button
    on an htm page, couldn't you? This makes it a client-side scriting problem,
    not ASP). ASP knows nothing about buttons or any other UI elements.

    But, read on.

    > The page itself is an ASP page called from a
    > website. I know a link would work but the rest of the page has
    > buttons and it would look cleaner to use a button.
    >
    > I've tried the below in a few variations, including using a href tags
    > inside the onclick. Anyone have a suggestion on what I'm doing wrong
    > here?
    >
    > <input type="button" value="<%=L_MBS_Text%>"
    > onclick="get(https://domain.com/size/")>
    >


    Is get() a function that you wrote? I think you want to set the current
    window's location to that url, correct? Like this:

    onclick="window.location = 'https://domain.com/size/';">

    Please follow up in a client-side scripting group such as
    ..scripting.jscript.

    Bob Barrows
    --
    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], Nov 17, 2005
    #3
  4. Sean M. Loftus

    Evertjan. Guest

    Sean M. Loftus wrote on 17 nov 2005 in
    microsoft.public.inetserver.asp.general:

    > I have a need to call an html page into the pane I'm viewing using a
    > button on an ASP page. The page itself is an ASP page called from a
    > website. I know a link would work but the rest of the page has buttons
    > and it would look cleaner to use a button.
    >
    > I've tried the below in a few variations, including using a href tags
    > inside the onclick. Anyone have a suggestion on what I'm doing wrong
    > here?
    >
    > <input type="button" value="<%=L_MBS_Text %>"
    > onclick="get(https://domain.com/size/")>


    This is a clientside JS problem, so OT on this NG
    please follow up elswhere

    <input type="button" value="<%=L_MBS_Text %>"
    onclick="location.href='https://domain.com/size/'">

    or

    <button
    onclick="location.href='https://domain.com/size/'">
    <%=L_MBS_Text%>
    </button>

    perhaps you want:

    <button
    onclick="location.href='<%=L_MBS_Link %>'">
    <%=L_MBS_Text %>
    </button>


    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Nov 17, 2005
    #4
  5. Bob Barrows [MVP] wrote:
    > onclick="window.location = 'https://domain.com/size/';">

    Oh shoot - I left out the href ... :-(
    --
    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], Nov 17, 2005
    #5
  6. Thank you,

    That worked fine, I was calling the link wrong...

    Sean


    "McKirahan" <> wrote in message
    news:...
    > "Sean M. Loftus" <sean(remove me)@loftus.org> wrote in message
    > news:...
    >> I have a need to call an html page into the pane I'm viewing using a

    > button
    >> on an ASP page. The page itself is an ASP page called from a website. I

    > know
    >> a link would work but the rest of the page has buttons and it would look
    >> cleaner to use a button.
    >>
    >> I've tried the below in a few variations, including using a href tags

    > inside
    >> the onclick. Anyone have a suggestion on what I'm doing wrong here?
    >>
    >> <input type="button" value="<%=L_MBS_Text%>"
    >> onclick="get(https://domain.com/size/")>
    >>
    >> --
    >> Sean M. Loftus
    >> Enterprise Architect
    >> Loftus Consulting, Inc.
    >> www.LoftusConsulting.com
    >> sean(removeme)@loftus.org

    >
    > You did not show us your get() function.
    >
    > Perhaps all you want is this:
    >
    > <input type="button" value="<%=L_MBS_Text%>"
    > onclick="location.href='https://domain.com/size/'">
    >
    >
     
    Sean M. Loftus, Nov 17, 2005
    #6
    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. Ryan Ternier
    Replies:
    4
    Views:
    4,026
    Cowboy \(Gregory A. Beamer\) [MVP]
    Jul 29, 2004
  2. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    902
    Kevin Spencer
    May 17, 2005
  3. Suzanne

    Problems with Link Button and Button web controls

    Suzanne, Dec 3, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    167
    Suzanne
    Dec 3, 2003
  4. charliewest
    Replies:
    1
    Views:
    142
    Bob Barrows [MVP]
    Jan 20, 2005
  5. Marley
    Replies:
    1
    Views:
    122
    Bob Barrows [MVP]
    Oct 8, 2005
Loading...

Share This Page