Passing parameter to event code from ASP 
Author Message
 Passing parameter to event code from ASP

Hi All
This is a frustrated newbie question.  I am trying to pass
a global variable set in server-side ASP script to client-
side script located in the same asp file (Specifically a
Form object's OnSubmit event).  Everything I have tried
has not worked.  Oh, I am using VBScript since its for a
intranet and all use IE.  
example: intNumRows set in ASP script - need to pass its
value to client-side script so can loop through some
iterative validation routines.
Please advise how I do this.
thanks


Sun, 26 Dec 2004 23:52:35 GMT  
 Passing parameter to event code from ASP
<%
  Dim intNumCount, strData

  intNumCount = 500
  strData = "My String Data Without Quotes"
  strData2 = "My ""String"" Data With Quotes"
%>

<script language="VBScript">
  Sub Window_OnLoad()
    Dim intNumCount, strData, strData2

    intNumCount = <%=intNumCount%>
    strData     = "<%=strData%>"
    strData2    = "<%=strData2%>"

    MsgBox intNumCount & vbCrLf & strData & vbCrLf & strData2
  End Sub
</script>

Mythran



Mon, 27 Dec 2004 00:33:56 GMT  
 Passing parameter to event code from ASP
Just what I needed and more!...thanks for quick response
Chuck
Quote:
>-----Original Message-----
><%
>  Dim intNumCount, strData

>  intNumCount = 500
>  strData = "My String Data Without Quotes"
>  strData2 = "My ""String"" Data With Quotes"
>%>

><script language="VBScript">
>  Sub Window_OnLoad()
>    Dim intNumCount, strData, strData2

>    intNumCount = <%=intNumCount%>
>    strData     = "<%=strData%>"
>    strData2    = "<%=strData2%>"

>    MsgBox intNumCount & vbCrLf & strData & vbCrLf &
strData2
>  End Sub
></script>

>Mythran

>.



Mon, 27 Dec 2004 00:49:21 GMT  
 Passing parameter to event code from ASP


Quote:
> Just what I needed and more!...thanks for quick response
> Chuck

No Prob...Keep the questions coming!

Myth



Mon, 27 Dec 2004 03:00:52 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. pass parameter to event

2. passing parameter from web browser control to asp page

3. Passing parameters between .ASP and ActiveX Document

4. How can I pass parameters between ASP and ActiveX Document

5. How to pass a data parameter through ASP?

6. NEWBIE question : Passing Login and Parameters from ASP

7. passing multiple items for 1 parameter w/ asp?????

8. Passing Parameters via ASP

9. Passing Parameters in ASP

10. Problem Passing Parameter to ACCESS Query from ASP

11. Passing Parameter to Access via ASP and ADO

12. passing parameter from web browser control to asp page

 

 
Powered by phpBB® Forum Software