Last post Dec 06, 2010 04:53 AM by ankur.nigam
Nov 30, 2010 07:36 PM|frankabel|LINK
I want handle the requests to my application "http://example.com/whateverpath" by a custom HttpHandler but the return things depending of the value of "whateverpath".
So users accessing "http://example.com/path1" will get different response than users accessing "http://example.com/path2", but both request must be handled in the same HttpHandler. The idea is find "whateverpath" in a database and depending of the result, return
the response content.
I hear about URL routing and I already have a custom Http handler working, but can I combine both technique to get what I need?
I will appreciate any comment respect this issue.
HttpHandler "ASP Development Server" URL routing
Dec 06, 2010 04:53 AM|ankur.nigam|LINK
To implement URL Rewriting with HTTP handlers, I suggest you to follow the below given link. It talks about how to write ProcessRequest method to redirect to desired page.
In the ProcessRequest event, we can identify the requested page and redirect it to desired ASPX page along with query parameters as Query String. In the ASPX's page load event, you can find the parameters embedded as query string and fetch and load appropriate
information in ASPX page.
In case, if you have some controls that would result in postback as well then forget not to refer the following article as well. In the following article, read on from heading that says - "Handling Postbacks." It talks about Actionless form which would be
helpful to you.