Reputation: 908
I have a situation where my web application sits and waits for a request sent to a specific web page designated for that source. For example source1 makes a request to myapplication/source1.aspx and source 2 makes a request to myapplication/source2.aspx. I was wondering if it is possible to have it so that instead have having 10 different .aspx pages actually out sitting waiting for requests, if I could somehow configure my application to "fake" that those pages exist and actually have a single page to process the requests.
So basically source1 would post to the URL of myapplication/source1.aspx but my application interprets that and sends it on to the main processing page. The one catch is that the main page needs to also know which source it came from.
I cannot rely on the source being able to post to myapplication/processPage?Source=Source1 so that I could then figure out from the query string which source sent what.
I hope all of this made sense, please let me know if you need further clarification. Thank you for your help.
Upvotes: 0
Views: 141
Reputation: 2159
One idea would be to create a custom handler, then map to the expected requests. Here is a link for more information on handlers.
Pay special attention to the configuration that goes into your web.config for each handler. The path that is defined does not have to be a path that exists.
One nice trick is to place your handler configuration within a grouping within your web.config. That way you can have various "virtual" paths within your application for handling different scenarios.
Upvotes: 1