Call Asp Procedure from Hyperlink

Is it possible to call an asp Procedure or Function from a hyperlink? I am trying to call a procedure when I click on a text link.

i.e.

…a href=<%call MyProcedure(arg)%> click me </…

That example doesnt work because it just writes the contents of MyProcedure in to the link.

THANKS FOR ANY HELP!!!:to:

no, there’s no way I know of to do that…

agreed. There is no way to do that.

Alternatives:

set a special GET var in the link(like myProc=1) and then if the GET var is 1, then call myProc wherever you want.

or

Use javascript(harder, but user doesn’t need to wait for another page to load before they can read some text)

What does the procedure do? VBScript procedures in ASP run on the server, so at best the procedure can return some text to the browser. Do what njs12345 is saying, make the link:
<a href=“http://myserver.com/PageWithProcedure.asp?arg=somevalue”>Click Me</a>

Then in the ASP page do:


If Len(Request.QueryString("arg")) > 0 Then
   Call MyProcedure(Request.QueryString("arg))
End If

Thanks for the replies.

The procedure writes a table filled with information from a recordset. I know that there are other ways to do record navigation, like using querystrings and such, but wanted to try this.

Basically here is the layout I was trying to achieve…

Open recordset
fill array with recordset rows
close record set

Sub FillTable(direction)
if direction = 1
Display next record using array
else
Display previous record using array
End Sub

Then at the bottom I would have the links saying

Prev and Next that would call the procedure to fill the table without having to load a new page.

Sorry if this is unclear.

So Sub FillTables is VBScript running on the client side? Because if it is not running on the client side, then you would still have to reload the page anyway to run that procedure. And, if it is running on the client side it will only work with IE.

Ok, I gotcha now. I’m kinda new to server side, but now I understand why my way won’t work.

Thanks!!:beer: