Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass a variable to a javascript function in another ASP page?

Status
Not open for further replies.

kondakindi

IS-IT--Management
Apr 18, 2005
31
US
I call a vb function in an another page from an asp page which inturn has to return a variable to the initial asp page to be accessed by the javascript of the page.

Lets say i am calling a function in an asp page B from an asp page A, the function in the page B has to return a variable back to page A where the variable can be accessed by a java script function.

I am not sure how this can be done. Does anyone have any idea on this.

Thanks in Advance.
 
not completely sure of your question...lets say you have something like this on your page A

<script language="VBscript">
Sub Myfunction(myvariable)
Window.Open "pageB.asp?myvariable="&myvariable
End Sub
</script>

now on pageB, you can get this variable myvariable using

request.querystring("myvariable")

now after this i dont understand...

do you have another function in pageB that returns value to pageA ??

clarify more...

-DNG
 
you can write a variable from an asp page to javascript. For example if you are passing the session variable session("test")=123 from page b to page a on page a you could have

Code:
<%if session("test")<>"" then%>
<script language="javascript">
  function test(){
    alert("<%=session("test")%>")
  }
</script>
<%end if%>


}...the bane of my life!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top