Saving Information for Page Reload

  • Thread starter Thread starter DFDavis
  • Start date Start date
D

DFDavis

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
}
 
How about you put some strings in your Session["test"]? I never hit problem
though

chanmm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top