473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

how to save a value of the data in to a session

syedshaffee
hey people ,

i need help
Expand|Select|Wrap|Line Numbers
  1.  $(document).ready(function () {    
  2.     //assigning alternative row style
  3. $("#Table_Data tr:even").addClass("evenrow");
  4. $("#Table_Data tr:odd").addClass("oddrow");
  5.  
  6.  $("#Table_Data tr").click(function(){
  7.    $(this).find(':checkbox').attr('checked', ! $(this).find(':checkbox').attr('checked'));    
  8.    if($(this).find(':checkbox').attr('checked'))
  9.         {
  10.               var html = '';
  11. $(' #Table_Data td').click(function() {
  12.     html = $(this).text();
  13.     alert(html);
  14. });
  15.  
  16.         }
  17.         else
  18.         {
  19.             $(this).removeClass('highlight');
  20.               $(this).addClass('evenrow');
  21.         }
  22. });
  23. });
  24.  
This is the code which retrieves the value from a table-data when clicked on it now i want to store that data in a session How would i do that???
Jan 19 '12 #1
7 1690
C CSR
144 100+
Try this.

Expand|Select|Wrap|Line Numbers
  1. dataToSave = "Save this String to Session"
  2. Session("saveData")= dataToSave
  3. Response.Write Session("saveData")
  4.  
The "Session" object has some other features that you should probably study in addition to this, like how it can be used in the global.asa, and commands to use inside the page, etc. Hope this helps.
Jan 19 '12 #2
OK than x for the reply friend how do i do that in javascript/Dhtml i knew about he syntax of it than x a million for the reply


can you? please help me on this
Jan 19 '12 #3
C CSR
144 100+
I misunderstood since your question was in category ASP.

I think the syntax is basically the same. Maybe use single quotes?
for the variable string 'saveData'.

Expand|Select|Wrap|Line Numbers
  1. Session('saveData')= dataToSave; 
  2.  
I'm not sure of your question here though because you said you already know the syntax?
Jan 19 '12 #4
OK i will try this Thank u
Jan 19 '12 #5
hey i tried that but it doesn't work.It's giving a message 'Error on this page'
Jan 19 '12 #6
C CSR
144 100+
I checked a few things out. Apparently you can do it but not the way we're trying to because its stored server-side; Javascript is client side. I can try to look further into this or repost a question with a title like:

"using javascript session variable"


I just don't know that off the top of my head. Someone else should see this post and maybe help you. My apologies.
Jan 19 '12 #7
C CSR
144 100+
Found this, but I haven't tried it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Page_Render(ByVal sender As System.Object, ByVal e As
  2. System.EventArgs) Handles MyBase.PreRender
  3. RegisterClientScriptBlock("ddd", "<script type='text/javascript'> var
  4. color = '" + Session("Color") + "';</script>")
  5. End Sub
  6.  
  7.  
Jan 19 '12 #8

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

Similar topics

1
by: SOAP | last post by:
how to save binary data to database by using CMP2.0? I would like to save a save image to database through EJB. but I don't know which data type shoud I use. any examples? thanks a lot
2
by: Cheung Wang Tin | last post by:
How can I set in web.config, so that session is enable, but never timeout? Thank you.
1
by: Samuel Stanojevic | last post by:
- I'm using .NET Framework 1.1. I just noticed that whenever I change the value of Session.Timeout (no matter which aspx page this happens on), at the end of the request, the 'Session_End'...
2
by: Leon | last post by:
Can you write over a value in session or do you have to delete the value first then re-create it? **Example: I have the following value in session state... Statement 1 -- Session.Add("Email",...
1
by: Mohsin | last post by:
Hi, any one can help me to save visual Basic Data in Access to link through Data control or ODBC. when i am trying to save vb data in Access after making link through data control it is not saving...
5
by: manuhack | last post by:
I've written a program in Python to get some data from a website. The data structure is as follows. Every day there are new data. For each day, there are many stocks. For each stock, there are...
0
by: amrhi | last post by:
Hy Guys , Can anybody help me ? I try to make small web database in my unit. Some of fields have on change behaviour to get other data that automatically filled other text field. But when i try to...
5
by: mallz | last post by:
hi, i need to get the value of the variable which i have put into a session variable in another jsp form. Im using this to get the value: (String)session.getAttribute("thename") But, im not...
5
by: sirimanna | last post by:
hello, i'm new to VB...i like to know how to open some text data save in c: in to text box.. i know to save cord's to save data in text box in to c:..but i don't know how to get back that save...
3
by: koneru9999 | last post by:
i have one storedprocedure in database.from that i can get last login time .i fetched that value and assigned that value to session in one servlet class.from that session i am getting that last login...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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
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
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...
0
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
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,...

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.