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!
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:
Page2.aspx.cs: