
ASP ot VBScript / VBScript to ASP
Anything you put in your <SCRIPT> tag (unless you specifically specify to run on
the server) will run on the CLIENT side. On the other hand, the .asp "<%="
substitutions will happen on the SERVER side, BEFORE the page is even sent to the
client.
If you want to set Session("CustomerName") to the value of a CLIENT-side form
element value (which it looks like you want), then you need to SUBMIT the form to
an .asp script.
The form would look something like this:
<form methof="post" action="myASP.asp">
<input type="checkbox" name="cboCustomerName">
<input type="submit">
</form>
The SEVER-side script myAsp.asp would then do something like this:
<% Session("CustomerName") = Request("cboCustomerName") %>
Quote:
-----Original Message-----
I am very sorry, I am confuse about the relationship between ASP to
VBScript, ASP to Javascript or Vbscript to Javascript
<SCRIPT LANGUAGE=vbscript>
SUB cboCustomerName_OnChange
'"<%Session("CustomerName")%>" =
frmCustomer.cboCustomerName.value ----------- return ERROR
msgbox "<=%Session("UserName")%>" ----------- return NOTHING
END SUB
</SCRIPT>
i just needed to pass frmCustomer.cboCustomerName.value into
Session("UserName")
Thank you...........
> You're mixing apples and oranges...
> Or more precisely server side code and client side code. The distinction
> between the two is a pretty fundamental concept.
> I'd recommend that you pick up a good book on ASP - Wrox Press publishes
> lots of ASP titles and they're all good.
> --
> Michael Harris
> Microsoft.MVP.Scripting
> --
> Please do not email questions - post them to the newsgroup instead.
> --
> > Hello,
> > Does anyone know how to pass value into Session("UserName") inside vb
> > script tag
> > i have try
> > <SCRIPT LANGUAGE=vbscript>
> > SUB cboCustomerName_OnChange
> > "<%Session("CustomerName")%>" =
> > Customer.cboCustomerName.value --------Line 1
> > msgbox
> > --------Line 2
> > END SUB
> > </SCRIPT>
> > Line 1 --- return error
> > Line 2 --- the msgbox display nothing
> > --
> > --------------------------------------------------------------
> > Any suggestions would be appreciated.
> > Thank You
> > Khai Mun, Ng
.