Home > DeveloperSection > Forums > Using Session values inside VBScript
ben reitman
ben reitman

Total Post:96

Posted on    June-20-2013 2:06 AM

 VB Script VB Script 

 1 Reply(s)
 1111  View(s)
Rate this:
Hi Expert,

This is an excerpt from an old authentication technique. I'm trying to assign a different value to the Document.Form.XXXXX.Value variables. The values I want are stored inside a Session variable from a separate .asp file.

Is there any way to use classic ASP Sessions inside VBScript? Or is there any way to store the Session variables' values in such a way that they can be used inside a 

VBScript block?

<script language="VBScript" type="text/vbscript">
Document.Form.txtUniqueID.Value = Auth.QuicklookID
Document.Form.txtUserID.Value = Auth.NTUserID
Document.Form.txtDomain.Value = Auth.NTDomain
Document.Form.txtUsername.Value = Auth.UserName
Document.Form.txtBusinessName.Value = Auth.BusinessName

Any help or clarification will help immensely, I'm a newcomer to VBScript.

Sumit Kesarwani

Total Post:378

Posted on    June-20-2013 6:54 AM


If I'm understanding your question correctly, you are trying to assign client side inputs (through a click event perhaps) with server side values? Assuming so, you need to wrap the session values with the <%= %> tags.

Try something like this:

<script language="VBScript" type="text/vbscript">
Document.Form.txtUniqueID.Value = "<%=Auth.QuicklookID%>"
Document.Form.txtUserID.Value = "<%=Auth.NTUserID%>"
Document.Form.txtDomain.Value = "<%=Auth.NTDomain%>"
Document.Form.txtUsername.Value = "<%=Auth.UserName%>"
Document.Form.txtBusinessName.Value = "<%=Auth.BusinessName%>"

I hope it helpful for you. 

Don't want to miss updates? Please click the below button!

Follow MindStick