RE: I have fixed ASP.NET check it out



Howdy,

John, I've just had a look on two topics created by you (this and about
debugging). Just go back your lovely VB and ASP technologies and stop making
annoying posts :)
ASP.NET is object oriented platform with quite nice background, designed to
make web programming faster and what is more important – to put some order in
big projects. I’ve seen some many messy ASP and VB applications written in
the same way you showed above. My advice John is to start understanding the
idea of new technologies and to stop complaining about everything what’s
different you got used to or you don’t understand.

Regards

Milosz Skalecki
MCP, MCAD

"John Rivers" wrote:

> This shows you how to implement html rendering methods
> and libraries in ASPX pages.
>
> This also means super fast debugging as no re-initialising
> of IIS is required after editting!
>
> This gets around the ridiculous situation of ASPX pages
> not being allowed to have methods.
>
> I am working on a way to do this with classes as well!
>
> Here is how to do it:
>
> you will create two ASPX pages:
>
> - FixASP.asp (the page that actually gets called)
> - Library.asp (the page that provides library methods to FixASP.asp)
>
> the key thing to note is that we are tricking the ASP.NET compiler
> by closing the hidden render method with a brace, then we omit
> the last closing brace of our code because ASP.NET will put it in for
> us!
>
> Contents of FixASP.asp:
>
> (start)
> <%
> InitLib(__output, parameterContainer);
> PageStart("ASP.NET is sane again!");
> PageHeader();
> PageMethod();
> PageFooter();
> PageEnd();
> %><!--#Include File="Library.aspx"--><%
> }
> void PageMethod() {
> %>this is the page method<%
> %>
> (end)
>
> Contents of Library.asp:
>
> (start)
> <%}
> //Don't change this bit
> private System.Web.UI.HtmlTextWriter __output;
> private System.Web.UI.Control parameterContainer;
> void InitLib(System.Web.UI.HtmlTextWriter o, System.Web.UI.Control pc)
> {
> __output = o;
> parameterContainer = pc;
> }
> //Convenience methods go here
> string HTML(string data) {
> return HttpUtility.HtmlEncode(data);
> }
> string URL(string data) {
> return HttpUtility.UrlEncode(data);
> }
> string QPX(string name, string val) {
> return URL(name) + "=" + URL(val) + "&";
> }
> //Add your rendering methods here!
> void RenderLink(string Title, string URL) {
> %><a href="<%=HTML(URL)%>"><%=HTML(Title)%></a><%
> }
> void PageStart(string Title) {
> %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <html>
> <head>
> <title><%=HTML(Title)%></title>
> </head>
> <body><%
> }
> void PageHeader() {
> %><h1>This is the page header</h1><hr/><%
> }
> void PageFooter() {
> %><hr/><h1>This is the page footer</h1><%
> }
> void PageEnd() {
> %></body>
> </html><%
> }
> //Don't change anything after this
> void ButtPlug() {
> //this is the end
> %>
> (end)
>
> now set FixASP.asp as your StartPage
> and hit F5
>
>
.