Joem Orcullo

Joem Orcullo

  • NA
  • 10
  • 14.7k

How can i pass the value of 2nd page to the default page?

Feb 19 2016 8:46 AM
I want to pass the value of label on my MSG.aspx.cs to Default.aspx.cs.

I'm using a session here, does anyone know any other options on how to do this??

(If my question is not clear, The program is loading the Default.aspx.cs first then on Page_Load it should call the MSG.aspx.cs then get the value of label on MSG.aspx.cs)
 
What I have tried:

Default.aspx.cs
  1. protected void Page_Load(object sender, EventArgs e)   
  2. {      
  3.    lblName.Text = Session["name"].ToString();   

MSG.aspx.cs
  1. Match sndrNameMatch = Regex.Match(body, @"From: ([A-Za-z0-9\-]+)", RegexOptions.IgnoreCase);                
  2.   
  3. lblName.Text = sndrNameMatch.Value;   
  4. Session["name"] = lblName.Text; 


Answers (2)