?
Solved

Calling codebehind aspx.vb function from aspx page using javascript

Posted on 2005-03-28
3
Medium Priority
?
778 Views
Last Modified: 2008-01-09
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
Comment
Question by:DerekVM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 13647018
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
 

Author Comment

by:DerekVM
ID: 13647063
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
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 1600 total points
ID: 13647320
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question