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
- protected void Page_Load(object sender, EventArgs e)
- {
- lblName.Text = Session["name"].ToString();
- }
MSG.aspx.cs
- Match sndrNameMatch = Regex.Match(body, @"From: ([A-Za-z0-9\-]+)", RegexOptions.IgnoreCase);
-
- lblName.Text = sndrNameMatch.Value;
- Session["name"] = lblName.Text;