473,657 Members | 2,517 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How i can create Seasson variable (ASP) through VBscript

14 New Member
It is possible create Seasson variable (ASP) through VBscript?
Apr 2 '10 #1
5 8088
GazMathias
228 Recognized Expert New Member
It is done like:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. session("variable") = "value"
  3. %>
  4.  
The Session Object

Gaz
Apr 3 '10 #2
asdasd10
14 New Member
i dont mean that i want to get a vbscript variable into Session variable in vb script

like that

<script type=text/vbscript>
dim n
n = 3
<%Session("vari able") = %> & n
</script>

i want to do somthing like that but its not working
Apr 3 '10 #3
GazMathias
228 Recognized Expert New Member
i want to do somthing like that but its not working
Of course it isn't.

Code between <% and %> is executed at the server and the <script type = text/vbscript> is executed at the browser (IE engine browsers only to my knowledge).

You therefore have to post the value you want to store in session back to the server using Post or Get and then assign it like I illustrated above.

Gaz
Apr 3 '10 #4
asdasd10
14 New Member
look what i wrote :
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim n
  3. n = 1
  4. %>
  5. <html>
  6. <head>
  7. <script type="text/vbscript" language="VBScript"  >
  8.     Sub buy(obj)
  9.  
  10.  
  11. <%
  12. Session("productID") = %>&obj.name
  13. Msgbox "<%=Session("productID")%>"
  14.  
  15.  
  16. end sub
  17.          </script>
  18.  
  19. </head>
  20. <body dir="center">
  21. <%
  22. path = Server.mappath("../db/ServerData.mdb")
  23. set con = Server.createobject("ADODB.Connection")
  24. con.open "driver={Microsoft Access Driver (*.mdb)};DBQ="&path
  25. set r = con.execute("select * from products")
  26. response.write "<form method='post'  >"
  27. response.write "<table border='0' width='100%' cellspacing='50px'>"
  28. response.write "<tr>"
  29. response.write "<th>Number</th>"
  30. response.write "<th>Name</th>"
  31. response.write "<th>Picture</th>"
  32. response.write "<th>Description</th>"
  33. response.write "<th>Price</th>"
  34. response.write "<th>Quanty</th>"
  35. response.write "<th>Order</th>"
  36. response.write "</tr>"
  37. do until r.eof
  38. response.write "<tr>"
  39. response.write "<td>"&r.fields("ItemID")&"</td>"
  40. response.write "<td>"&r.fields("Name")&"</td>"
  41. response.write "<td><img src='"&r.fields("Picture")&"'></td>"
  42. response.write "<td>"&r.fields("Description")&"</td>"
  43. response.write "<td>"&r.fields("Price")&"</td>"
  44. response.write "<td><input type='text' size='1' value = '1' ></td>"
  45. response.write "<td><input type='submit' onclick='buy(me)' value='buy this product' name='"&n&"'></td>"
  46. response.write "</tr>"
  47. n=n+1
  48. r.movenext
  49. loop
  50. response.write "</table>"
  51. response.write "</form>"
  52. %>
  53.  
  54. </body>
  55. </head>
  56. </html>
  57.  
i want to build asp store but simple not somthing hard and at the other page like order.asp i dont know how to find which product the Ueser/client chose
Apr 3 '10 #5
RedSon
5,000 Recognized Expert Expert
Next time use code tags. Please read up on "how to ask a question" located here -> http://bytes.com/faq.php?faq=how_to_ask_a_question.

Please do post code without code tags in the future.
Apr 5 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
72142
by: Jonas Daunoravicius | last post by:
The subject pretty much sums up what I need to do. Here is what I have so far, but still can't figure out how to get it working: <script language="javascript" type="text/javascript"> function fillForm() { // split the query string into pieces var qs = location.search.substr(location.search.indexOf("?")+1); qs = qs.split("&"); alert(qs); // qs is the variable that I need to pass into a
6
13815
by: BP Prgm | last post by:
This is my VBScript function: <script language="JavaScript" type="text/JavaScript"> Dim UN Set objNet = CreateObject("WScript.NetWork") Set objUser = GetObject("WinNT://my domain/" & objNet.UserName ) UN = objNet.UserName & " (" & objUser.FullName & ")" </script> How can I reference the VBScript Variable UN in my ASP code?
3
15180
by: Matt | last post by:
<% hour = Request("controlname") %> will yield the following error: Microsoft VBScript runtime (0x800A01F5) Illegal assignment: 'hour' However, if I declare hour, then it is fine. <% Dim hour hour = Request("controlname") %>
8
2387
by: Dave Thomas | last post by:
I have developed a web site using asp pages that use both vbscript and javascript. Run the site on my PC and everything is fine. Ftp to my web hosting provider which hosts asp pages and look on my site only to find my vbscript is not recognised. It is treated as pure text so you see <% =Request.Form("LoginId") %>. Also see all the vbscript when you "View Source". I have e-mailed my host provider but thought this may be quicker! Any ideas...
6
12756
by: ASPfool | last post by:
Hello everyone, Please help me before I throw my computer out of the window: I'm working on a web application in classic ASP (vbscript), which is making calls to some webservices. The calls are made using SOAP - i installed the SOAP3 toolkit on my windows 2k server to enable this. The webservice calls are returning String Arrays which I can't seem to do anything useful with. The call shown below returns a string array with two...
2
2588
by: ChucRock | last post by:
Hi, I have the following code where there is some client side VBScript that does something and needs to pass a variable back to the ASP.NET page. When the page is updated through a postback, the information is lost. What am I doing wrong? After obtaining the variable, I assign it back to a Label text field on the form, it shows up on the web page no problem.
2
1917
by: alan | last post by:
Hi all, I need to pass a variable to the client-side vbscript and when the button is pressed invoke the script (SomeSub()). The problem is, that the "blablabla" appears only after second pressing of the button. Probably there is something with the postback, but I cannot figure it out. My .aspx :
3
6179
by: hermand | last post by:
I've got an online job application I am building using ASP/VBScript. The application consists of one ASP document which has three separate states. States: 1. Form Display 2. Form Review (takes all information submitted from the first form state and removes the form elements and displays entered information using "Response.form()".
12
7899
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug it, it works every time! I even set it to True, but did a .Flush just before the error, and the error won't happen. It only happens when response.buffer is True and no .response.flush is issued. The error is a string variable turns-up empty...
3
8539
by: Michael | last post by:
Hi. I have COM+ component installed on my XP. I have problem to create instance of it inside vbscript. How can I do it? The error I get is : ActiveX component can't create object. Thanks
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7333
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.