Just a quick note that I have placed an article here on a utility class for handling http form data. The idea is to allow you to treat post or get data in a consistent manner for both retrieval and generation of data. It incorporates UrlEncoding and HtmlEncoding as appropriate to allow you to output sanitized code without dwelling on the details. The class allows you to treat as a writeable dictionary so that entries can be added or deleted as needed. You could probably write most of the code from this description, it is that simple. However, I do illustrate a solution to pass data of one's choice when making a Server.Transfer call.
In ASP.NET, Server.Transfer will either pass exactly the same data that the initial page received or no data at all. I use Thread Local Storage (TLS) to store a representation of form data. If you aren't familiar with it, TLS is an extremely useful feature within Windows that allow data storage on a per-thread basis. It is used to provide under the hood support for many cool features within and beyond .NET. An example feature is the idea of an ExecutionContext, which is actually patented by Microsoft.
No comments:
Post a Comment