473,498 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript - Assigning an object to Session variable

RA
Session("ListBoxHold") = document.getElementById("lstCodes")

The above statement gives an error "Object Expected"

Any Clue?
Nov 18 '05 #1
4 2149
Session is on the server. Javascript executes on the client.
Nov 18 '05 #2
RA
Well, many controls are on the server; but still we are able to exploit them
using javascript(on the client-side).

"Scott Simons" <Scott.Simons.At.MealMagic.Com.Remove.This> wrote in message
news:B4**********************************@microsof t.com...
Session is on the server. Javascript executes on the client.

Nov 18 '05 #3
Hi,

Try saving it to a cookie then retrieve it from code-behind.

Client-Side javascipt:
// Use this function to save a cookie.
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + "; path=/" +
((expires == null) ? "" : "; expires=" + expires.toGMTString());
}Server-Side c#public void GetCookie() { HttpCookie
aCookie = Response.Cookies["test"]; foreach (string s in
aCookie.Values.Keys) { Response.Write("Key: " + s
+ " Value: " + aCookie.Values[s] + = "<P>"); } }Hope this
helps,Yama
"RA" <rc***************@storis.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Session("ListBoxHold") = document.getElementById("lstCodes")

The above statement gives an error "Object Expected"

Any Clue?

Nov 18 '05 #4
Sorry something happened there maing it hard to read:

// Client-Side javascipt:
// Use this function to save a cookie.
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + "; path=/" +
((expires == null) ? "" : "; expires=" +
expires.toGMTString());
}

// Server-Side c#
public void GetCookie(){
HttpCookie aCookie = Response.Cookies["test"];
foreach (string s in aCookie.Values.Keys){
Response.Write("Key: " + s + " Value: " + aCookie.Values[s] + =
"<P>");
}
}
Hope this helps,

Yama

"Yama" <yk*****@stbernard.com> wrote in message
news:u$**************@TK2MSFTNGP11.phx.gbl...
Hi,

Try saving it to a cookie then retrieve it from code-behind.

Client-Side javascipt:
// Use this function to save a cookie.
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) + "; path=/" +
((expires == null) ? "" : "; expires=" + expires.toGMTString());
}Server-Side c#public void GetCookie() { HttpCookie
aCookie = Response.Cookies["test"]; foreach (string s in
aCookie.Values.Keys) { Response.Write("Key: " +
s + " Value: " + aCookie.Values[s] + = "<P>"); } }Hope
this helps,Yama
"RA" <rc***************@storis.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Session("ListBoxHold") = document.getElementById("lstCodes")

The above statement gives an error "Object Expected"

Any Clue?


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
5559
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
16
3192
by: Roman Ziak | last post by:
Hello, there were times when I used to be looking for a way to access JavaScript Global object similar to those found in VBScript or PHP ($GLOBALS). At present this has only academic value for...
10
1944
by: lkagan2000 | last post by:
I'm reading 'Ajax in Action', (one of the best of the many tech books I've read) and there's an example that I just don't fully understand. If you happen to have the book, it's on page 75. I'm...
4
19985
by: philin007 | last post by:
Hi , I have the following javascript codes: ****************************************** <script language="JavaScript"> <!-- .... ..... if (nextRow >5) {
28
2089
by: ensemble | last post by:
I'm trying to utilized a more object-oriented approach to managing window events in javascript. Thus, I am creating a "controller" object to handle events and interact with the server. However, I...
1
2129
by: --[zainy]-- | last post by:
Hello Guyz.. I want to assign a varascript value to a session object in javascript function... like i have an image and onClick i am calling a function sort_(str).. Now i want to assign this...
5
10266
by: aelred | last post by:
I have a web page where a member can open up a chat window (child window) with another member. - From there the member can also navigate to other web pages. - From other pages in the site, they...
2
8928
by: Palvids | last post by:
Hi, I want to assign some value to session variable in JavaScript written in c# code behind.I hv written like this: string map2 ="<script language='javascript'>"<%Session=varname;%>"; </script>";...
0
7005
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...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
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...
0
7381
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...
0
5465
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,...
0
3096
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...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
293
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...

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.