I am making a simple request parses that takes in urls with querystring parameters and spits back xml.
Right now this is all handled in a 开发者_Python百科default.aspx page, so I don't have to much around with url rewriting and such. Would it be better to keep the default.aspx page, but have the requests handled in the global.asax page?
Would it be more optimized that way?
For requests that don't need a full-blown ASP.NET page, you should take a look at the IHttpHandler
interface, or just create ashx
files.
I usually implement a BasePage class that inherits System.Web.UI.Page then have all of my pages inherit BasePage.
Put in methods that you want to use through out the site in the base page.
It sounds like what you are trying to do is what a HTTPHandler is designed for. Here is the reference if you are unfamiliar:
MSDN- HTTPHandler
精彩评论