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 7845661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:18:47+00:00 2026-06-02T17:18:47+00:00

I am facing problem in query string. Following is my asp code <asp:Label ID=Lable1

  • 0

I am facing problem in query string. Following is my asp code

  <asp:Label ID="Lable1" runat="server" Text=""  ></asp:Label>
  <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />

C# code:

  protected void Page_Load(object sender, EventArgs e)
{   
}
protected void Button1_Click(object sender, EventArgs e)
{
    Lable1.Text += Request.QueryString["refresh"] ;
    Response.Redirect("QueryString1t.aspx?refresh=" + 1 + "");    
}

Up to my knowledge Lable1 text should change on button click every time. Lable1 text should not show any thing on page load . on button click it should be like for first click 1 for second click 11 and so on..
But it is not showing as my expectation .So tell me please where i am wrong?

  • 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-02T17:18:49+00:00Added an answer on June 2, 2026 at 5:18 pm

    You are redirecting after setting label text, wrong approach.

    Try this: –

    protected void Page_Load(object sender, EventArgs e)
    {
        Lable1.Text = Request.QueryString["refresh"];
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("QueryString1t.aspx?refresh=" +
         string.IsNullOrEmpty(Request.QueryString["refresh"]) ? 0 :
          Convert.ToInt32(Request.QueryString["refresh"]) + 1 + "");    
    }
    

    OR this: –

    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Lable1.Text = string.IsNullOrEmpty(Lable1.Text) ? "0" :
            (Convert.ToInt32(Lable1.Text) + 1).ToString();  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Facing problem for generating SQL Server Query In the Following query dynamic conditions are
I am getting a value through Query string but facing some problem in printing
Facing a problem, it seems my data stored in SQL Server does not stored
Im facing following problem I have created mentioned condition, but when I choose y
I'm beginning under NodeJS/Express and I'm facing the following problem (I probably didn't get
Yii beginner here. I am facing some problem with how to query the database
I'm facing a problem with an SSIS package. A query is executed to obtain
i'm facing with this problem: I've a module containing something like this: <s:TextInput id=query
Here, in PHP code I am facing problem to redirect a page after valid
I am facing a wierd problem where the same query is returning different results.

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.