473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Activating sub routine from hyperlink

Ok, I am still playing with ASP and was wondering how to do this (it seemed
simple). What I want is to have a hyperlink that when it's clicked on, will
run a sub routine, instead of opening a web page... Right now I have;

Sub CreateLinks()
Response.Write "<br><br>"
Response.Write "<a href='OpenAllOrders()'>1. All Orders</a><br>"
Response.Write "<a href='OpenCustOrders()'>2. Customer Orders</a><br>"
Response.Write "<a href='OpenInvoices.asp'>3. Open Invoices</a><br>"
End Sub

Sub OpenAllOrders()
Response.Redirect "OpenOrders.asp?Customer=0"
End Sub

Sub OpenCustOrders()
Response.Redirect "OpenOrders.asp?Customer=1"
End Sub
The issue, is that clicking on the link, tries to open a web page file of
'openallorders()', instead of running the sub routine. Obviously I am
missing something simple... Can anyone point me in the correct direction
(think it has something to do with href... maybe it should be hsub or
something).
Jul 19 '05 #1
3 1571
the click has two choices.
1) run a CLIENTSIDE event/function/etc
or
2) post back and run a SERVER event/function/etc.

Can't have a clientside anything do a serverside anything

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Ruskin Hardie" <Ru******@xtra.NOSPAM.co.nz> wrote in message
news:i6*********************@news.xtra.co.nz...
Ok, I am still playing with ASP and was wondering how to do this (it seemed simple). What I want is to have a hyperlink that when it's clicked on, will run a sub routine, instead of opening a web page... Right now I have;

Sub CreateLinks()
Response.Write "<br><br>"
Response.Write "<a href='OpenAllOrders()'>1. All Orders</a><br>"
Response.Write "<a href='OpenCustOrders()'>2. Customer Orders</a><br>"
Response.Write "<a href='OpenInvoices.asp'>3. Open Invoices</a><br>"
End Sub

Sub OpenAllOrders()
Response.Redirect "OpenOrders.asp?Customer=0"
End Sub

Sub OpenCustOrders()
Response.Redirect "OpenOrders.asp?Customer=1"
End Sub
The issue, is that clicking on the link, tries to open a web page file of
'openallorders()', instead of running the sub routine. Obviously I am
missing something simple... Can anyone point me in the correct direction
(think it has something to do with href... maybe it should be hsub or
something).

Jul 19 '05 #2
Thanks for that Curt... But now I am more confused... How do I determine if
it is client or server side? How do I call the sub routine (on my servers
asp page), from a link? Can it be done?
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:eH**************@TK2MSFTNGP09.phx.gbl...
the click has two choices.
1) run a CLIENTSIDE event/function/etc
or
2) post back and run a SERVER event/function/etc.

Can't have a clientside anything do a serverside anything

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Ruskin Hardie" <Ru******@xtra.NOSPAM.co.nz> wrote in message
news:i6*********************@news.xtra.co.nz...
Ok, I am still playing with ASP and was wondering how to do this (it

seemed
simple). What I want is to have a hyperlink that when it's clicked on,

will
run a sub routine, instead of opening a web page... Right now I have;

Sub CreateLinks()
Response.Write "<br><br>"
Response.Write "<a href='OpenAllOrders()'>1. All Orders</a><br>"
Response.Write "<a href='OpenCustOrders()'>2. Customer Orders</a><br>" Response.Write "<a href='OpenInvoices.asp'>3. Open Invoices</a><br>"
End Sub

Sub OpenAllOrders()
Response.Redirect "OpenOrders.asp?Customer=0"
End Sub

Sub OpenCustOrders()
Response.Redirect "OpenOrders.asp?Customer=1"
End Sub
The issue, is that clicking on the link, tries to open a web page file of 'openallorders()', instead of running the sub routine. Obviously I am
missing something simple... Can anyone point me in the correct direction
(think it has something to do with href... maybe it should be hsub or
something).


Jul 19 '05 #3
sure.... but it will make another trip to the server...that's what I was
getting at.
you can check for the button name in the Request.Form variables when the
page loads.
Basically you asked if you can do it Without making another trip to the
server and the answer there is NO.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Ruskin Hardie" <Ru******@xtra.NOSPAM.co.nz> wrote in message
news:Fu*********************@news.xtra.co.nz...
Thanks for that Curt... But now I am more confused... How do I determine if it is client or server side? How do I call the sub routine (on my servers
asp page), from a link? Can it be done?
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:eH**************@TK2MSFTNGP09.phx.gbl...
the click has two choices.
1) run a CLIENTSIDE event/function/etc
or
2) post back and run a SERVER event/function/etc.

Can't have a clientside anything do a serverside anything

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Ruskin Hardie" <Ru******@xtra.NOSPAM.co.nz> wrote in message
news:i6*********************@news.xtra.co.nz...
Ok, I am still playing with ASP and was wondering how to do this (it

seemed
simple). What I want is to have a hyperlink that when it's clicked on,

will
run a sub routine, instead of opening a web page... Right now I have;

Sub CreateLinks()
Response.Write "<br><br>"
Response.Write "<a href='OpenAllOrders()'>1. All Orders</a><br>"
Response.Write "<a href='OpenCustOrders()'>2. Customer Orders</a><br>" Response.Write "<a href='OpenInvoices.asp'>3. Open Invoices</a><br>" End Sub

Sub OpenAllOrders()
Response.Redirect "OpenOrders.asp?Customer=0"
End Sub

Sub OpenCustOrders()
Response.Redirect "OpenOrders.asp?Customer=1"
End Sub
The issue, is that clicking on the link, tries to open a web page file of 'openallorders()', instead of running the sub routine. Obviously I am
missing something simple... Can anyone point me in the correct direction (think it has something to do with href... maybe it should be hsub or
something).



Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: niv | last post by:
i have a database, one of the fields is a hyperlink to a htm file. i want to activate it automaticly as the asp file is loaded no click is needed.so that the background of the BODY part will...
2
by: niv | last post by:
thank you ken for not givving up. i think i dont make my self clear, what i to do is to have a web page that i can administrate its content and apperance from a database, each web page has three...
1
by: Jeppe 1971 | last post by:
Hi Does anyone know of a way to load a HTML-page and examine the document without activating the code? I am trying to create a search-function in javascript. The idea is that the function...
1
by: Badboy36 | last post by:
Hello user from googlegroups, i made a microsoft access database with front and backend. i created the backend in microsoft access97. for the frontend i made two versions (one for microsoft...
0
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif...
1
by: Chris | last post by:
I have a need to automatically save a record when a user leaves me form. Everything works great unless the user uses the grid and selects an item via a link column. Then I can't capture the record...
2
by: Beejer | last post by:
I have a weird problem that I'm trying to solve but can't seem to find a solution at this time. My Access database closes completely when the "Else" of the VBA code is applicable. I'm running...
20
by: tshad | last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the problem. Apparently, it doesn't figure out the path correctly. It uses the path of the file it is in, even if it is...
2
by: Hrvoje Vrbanc | last post by:
Hello all! As I have only recently started to use native ASP.NET 2.0 data access controls (and found them to be very powerful), I have one question that I was unable to find the answer to: -...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.