For Programmers: Free Programming Magazines  


Home > Archive > ASP > November 2005 > Calling html link from a button?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Calling html link from a button?
Sean M. Loftus

2005-11-17, 6:55 pm

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


McKirahan

2005-11-17, 6:55 pm

"Sean M. Loftus" <sean(remove me)@loftus.org> wrote in message
news:eIKM5s46FHA.1032@TK2MSFTNGP11.phx.gbl...
> 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/'">


Bob Barrows [MVP]

2005-11-17, 6:55 pm

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.


Evertjan.

2005-11-17, 6:55 pm

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)

Bob Barrows [MVP]

2005-11-17, 6:55 pm

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.


Sean M. Loftus

2005-11-17, 6:55 pm

Thank you,

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

Sean


"McKirahan" <News@McKirahan.com> wrote in message
news:Wr2dnbvuQ7KvOeHeRVn-oQ@comcast.com...
> "Sean M. Loftus" <sean(remove me)@loftus.org> wrote in message
> news:eIKM5s46FHA.1032@TK2MSFTNGP11.phx.gbl...
> button
> know
> inside
>
> 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/'">
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com