asp.net provides us with many easy ways to build our web system, especially the code-behind technique which amazingly allows a separation of layout and code. however, asp.net also offers some mechanisms to allow you to build a custom programming model more than that offered by code-behind. one mechanism is http handler which gives you a means of interacting with the low-level request and response services of the iis web server, and provides functionality much like isapi extensions but with a simpler programming model. great! this mechanism is just what i do like most, because it gives me a nice feeling that everything is under my own control and i´m free. 【相关文章:strcpy, StrCopy还是lst】
introduction 【扩展阅读:Oracle数据安全面面观(一) 】
notes: it´s the first time that i programmed asp.net, the first time that i programmed in c#, the first time that i touched iis, the first time that i submitted an article to code project. so, there must be some problems or something not good enough in the article and code. and i do welcome any feedback. thanks! 【扩展信息:Oracle数据安全面面观(二) 】
but when you are writing custom http handlers, hard-coding the page layout is boring and error-prone. we do need a way to separate layout from code. thus, class tmplparser, templatepool etc. were born. the main job of class tmplparser is to parse a layout template file with some tags and labels whose rules are simple and defined by myself :-). the class templatepool is used to buffer a set of templates, which can reduce the i/o operations with less template file reading, and improve the performance. i will illustrate how to use them to separate layout from code, later in this article.
using the code
first, i will tell you the rules of using the parser and some basic information as well.
... 下一页