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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:48:50+00:00 2026-05-11T22:48:50+00:00

Currently I have two pages: The first page contains an input form, and the

  • 0

Currently I have two pages:

The first page contains an input form, and the 2nd page generates an excel document. The input form’s button posts to this 2nd page.

What I’d like to do is add a second button which also posts to the 2nd page; however, I’ll need requests created from this new button to act differently, which brings me to my question:

Is there a way I can tell, from the 2nd page, which button was pressed to submit the request?

The main reason I’m asking is I’d like to re-use the 2nd page’s logic in parsing the information from the first page if possible; I’d rather not have to copy it to a new page and have the new button post to that.

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-05-11T22:48:50+00:00Added an answer on May 11, 2026 at 10:48 pm

    You could have a hidden text box on the form from the first page that each button sets a value in before posting to the second page. The second page could then evaluate the value of that hidden text box.

    Edit: After re-reading your post, I think I misunderstood what you were attempting to accomplish. If you’re simply trying to determine which button on the sending page was clicked, it could be done with the querystring:

    Page1.aspx:

    <asp:Button ID="Button1" Text="Button 1" PostBackUrl="~/Page2.aspx?button=1" runat="server" />
    <asp:Button ID="Button2" Text="Button 2" PostBackUrl="~/Page2.aspx?button=2" runat="server" />
    

    Page2.aspx.cs:

    string sButton = "0";
    if (Request.QueryString["button"] != null)
        sButton = Request.QueryString["button"];
    
    if (sButton == "1")
        // Do button 1 stuff
    else if (sButton == "2")
        // Do button 2 stuff
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form on my page which contains two select dropdowns. The first
Overview: I have two pages in my program; the main page and the other
I currently have two apps: app1/ app2/ templates/ app1.html app2.html In app1.html, I'm including
I currently have two panels within another large panel. The left panel is for
I (currently) have two forms, one that needs to call the other. In other
I currently have two threads running in my program: Main thread - Grabs image
We currently have two EC2 servers running apache servers with django wsgi on freebsd.
Is it possible to combine Underscore's filter and map? I currently have two separate
Currently using Xcode 4.2 and I have two view controllers (1 and 2). I
I currently have an app deployed on Heroku which runs on two web dynos

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.