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

  • Home
  • SEARCH
  • 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 6547331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:49:06+00:00 2026-05-25T11:49:06+00:00

I am working on a project and I found that the Session transferred value

  • 0

I am working on a project and I found that the Session transferred value not being displayed in Label on first click. On clicking the button for the second time only the Session transferred value is being displayed. The sample code is below please let me know how to get the value displayed on the first click. Note: Value to be displayed inside the IsPostBack function as I am using lots of functions inside IsPostBack

protected void Page_Load(object sender, EventArgs e)
{
    if (IsPostBack)
    {
        string kitty = Convert.ToString(Session["ping"]);
        Label1.Text = kitty;
    }
}
protected void Button1_Click(object sender, EventArgs e)
{

    string a = TextBox1.Text;
    Session["ping"] = a;
}
  • 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-05-25T11:49:06+00:00Added an answer on May 25, 2026 at 11:49 am

    I think I just figured how what you mean. You need to do this. PreRender occurs after the button click and will pick up the new value.

    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            string kitty = Convert.ToString(Session["ping"]);
            Label1.Text = kitty;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In writing some tests for a project I'm working on, I found that the
I'm working on a project that requires a button to only be pressed once
I am working on a project for college that uses GWT, Hibernate and Gilead.
I'm working on an asp.net project that uses an in-house developed custom SessionStateProvider class.
When rebuilding a perfectly working iPhone project on iOS 4 SDK, I found out
I am working on a project that communicates to a server through a URLConnection.
I have a Crystal Reports project that I am working on where I need
So I'm currently working on a project that needs to time when certain processes
I'm working on a project that requires 3DES encryption in Java. The issue is
I'm working on a project that relies heavily on communication between multiple WP7 devices.

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.