473,386 Members | 1,715 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,386 software developers and data experts.

Saving Information for Page Reload

I currently have information that I am writing to a <div runat="server"
id="hidden_text" /tag and when the user hits a button, I want to grab
that information so I can store it in a database. However everytime I
try, either with storing it in a session variable or by trying to work
with viewstate, I simply get nothing from either. How can I save this
information so I can actually work with it and put it into my database?

Session sample:
// This is done in a method that I have the init code set up as
the event handler for the button, then after performing this store, I
call the onclick method (actually called button1_click)
Session["test"] = hidden_text.innerHTML;

Onclick ( object sender, EventArgs e)
{
label1.Text = Session["test"].ToString().Trim(); //
just to see if the information is even being stored
}

Oct 12 '06 #1
1 1249
How about you put some strings in your Session["test"]? I never hit problem
though

chanmm

"DFDavis" <df*********@gmail.comwrote in message
news:11**********************@c28g2000cwb.googlegr oups.com...
>I currently have information that I am writing to a <div runat="server"
id="hidden_text" /tag and when the user hits a button, I want to grab
that information so I can store it in a database. However everytime I
try, either with storing it in a session variable or by trying to work
with viewstate, I simply get nothing from either. How can I save this
information so I can actually work with it and put it into my database?

Session sample:
// This is done in a method that I have the init code set up as
the event handler for the button, then after performing this store, I
call the onclick method (actually called button1_click)
Session["test"] = hidden_text.innerHTML;

Onclick ( object sender, EventArgs e)
{
label1.Text = Session["test"].ToString().Trim(); //
just to see if the information is even being stored
}

Oct 12 '06 #2

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

Similar topics

1
by: spiff | last post by:
I am very very new to jscript. What I want to do is set a variable in one frame of a page, and then reload another frame so that it uses the new variable. Is this possible? I want to have a...
3
by: jad101 | last post by:
I have an asp.net web page that: 1. Shows a message 2. Posts back (using javascript) 3. Reads contents of a file 4. response.write the contents of the file to the browser My issue is this: ...
3
by: RCS | last post by:
I have an app that I have different "sections" that I want to switch back and forth from, all while having the server maintain viewstate for each page. In other words, when I am on Page1.aspx and...
1
by: Tom | last post by:
I have a large application; lots of forms, multiple dynamic DLLs, etc. I also have, in the appliation, a general 'Preferences' class object (which is in itself a separate DLL, and I just include a...
1
by: R.A.M. | last post by:
Hello, I have written an .aspx page which calls Calendar.aspx page to select birth date which should be assign to some text box control on first page. Here's the code of first page: Birthdate:...
3
by: dshan | last post by:
Hi all, I can't find an answer to my quesiton anywhere. Given a drop-down list with USA states and other text fields I pass this information for further processing via PHP. If any of the...
3
by: dshan | last post by:
Hi all, I can't find an answer to my quesiton anywhere. Given a drop-down list with USA states and other text fields I pass this information for further processing via PHP. If any of the...
10
by: phforum | last post by:
Hi, I wrote a PHP page for user input the information to search the database. And the database data will update every second. I want to set the auto refresh to get the data from database every...
2
by: Mark B | last post by:
Even though I have EnableViewState set to true, CheckBox1 is not retaining its value (false) on page reload. I have an OnLoad page sub that queries a SQL table for the member's record. I use ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.