• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 780
  • Last Modified:

Calling codebehind aspx.vb function from aspx page using javascript

How do I call a apsx.vb function from the aspx page, passing variables.

Ex:

aspx.vb:
============
dim SomeFunction(x as string, i as integet) as string
   ... do something like

   SomeFunction =  str(i) & x
end function

aspx:
============
// would like to call above function like
vas String = "Variable"
var ss = <%SomeFunction(sString, 5)%>
alert(ss)

Page Displays:
===========
Variable5      (in a alert box)




0
DerekVM
Asked:
DerekVM
  • 2
1 Solution
 
COBOLdinosaurCommented:
That does not make any sense to me. Are you saying you want to try and run an ASP function on the client?  Not going to happen.  Asp can only run on the server.  You have to cross over and execute on the server and return the value.
 
Cd&
0
 
DerekVMAuthor Commented:
I don't mind the code executing on the server, but I want to make the call to the function from the client, passing variables to the function from the page.
0
 
COBOLdinosaurCommented:
The client can only call function that are client side, except for event handlers with runat="server".  or the client can submit something to the server to run a script containing the function.  There is no open context between the client and server for the kind of interactive functionality you are looking for.

Cd&
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now