Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8302075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:11:41+00:00 2026-06-08T17:11:41+00:00

I have buttons which each of it holds session. User need to click one

  • 0

I have buttons which each of it holds session. User need to click one of the button, then in the next page user can view the data clicked by them. Here is my code behind:

public partial class Welcome_Proton : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button3_Click(object sender, EventArgs e)
{
    Session["carA"] = Label1.Text;
    Response.Redirect("~/Welcome/BookingForm.aspx");
}
protected void Button4_Click(object sender, EventArgs e)
{
    Session["carB"] = Label1.Text;
    Response.Redirect("~/Welcome/BookingForm.aspx");
}
protected void Button5_Click(object sender, EventArgs e)
{
    Session["carC"] = Label1.Text;
    Response.Redirect("~/Welcome/BookingForm.aspx");
}
protected void Button6_Click(object sender, EventArgs e)
{
    Session["carD"] = Label1.Text;
    Response.Redirect("~/Welcome/BookingForm.aspx");
}
protected void Button7_Click(object sender, EventArgs e)
{
    Session["carE"] = Label1.Text;
    Response.Redirect("~/Welcome/BookingForm.aspx");
}
protected void Button8_Click(object sender, EventArgs e)
{
    Session["carF"] = Label1.Text;
    Response.Redirect("~/Welcome/BookingForm.aspx");
}
protected void Button9_Click(object sender, EventArgs e)
{
    Session["carG"] = Label1.Text;
    Response.Redirect("~/Welcome/BookingForm.aspx");
}
protected void Button10_Click(object sender, EventArgs e)
{
    Session["carH"] = Label1.Text;
    Response.Redirect("~/Welcome/BookingForm.aspx");
}
}

To retrieve back the session, I use this code in “BookingForm.aspx” code behind: string car = Session["car"].ToString();
The problem now is, what code should I write in order to retrieve back the session only click by user? How to retrieve only a session click by user? You may ask me if you not clear with my question. Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:11:42+00:00Added an answer on June 8, 2026 at 5:11 pm

    If I understood your question correctly, a quick and dirty solution would be to also save the key into the Session like this:

    protected void Button9_Click(object sender, EventArgs e)
    {
        Session["carG"] = Label1.Text;
        Session["buttonKey"] = "carG";
    }
    

    Once the BookingForm.aspx is loaded you can get the value from session using this code:

    private string GetSessionValue()
    {
        var key = Sesssion["buttonKey"] as string;
        return Session[key] as string;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two buttons, which the user can click and will open a FileDiagloag
I have one view holding a list of videos(buttons which can be clicked, each
I have few buttons of which each button is assigned a class with a
I'm trying to have a page with a bunch of buttons, each of which
In Application i have two buttons in which one button is used as a
I have a PHP script which is generating buttons to each content schedule. The
I have butons which are created dynamically, each button has an id set in
I have a custom UITableViewCell which contains several UIButtons. Each button's frame position is
I have two buttons that increment and decrement a value by one with each
I have an HTML table where each row has buttons which toggle status bits

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.