for one reason or another, I fiddled with the "minimalist" ASP.Net just for fun. I have disabled many things and am trying to redo things. One thing that I cannot understand is how to make an ASP.Net (aspx) page.
This is my progress:
//global.asax protected virtual void Application_BeginRequest (Object sender, EventArgs e) { HtmlTextWriter writer=new HtmlTextWriter(Response.Output); if(Request.Url.AbsolutePath.Substring(0,Math.Min(Request.Url.AbsolutePath.Length,8))=="/static/"){ return; //let it just serve the static files }else if(Request.Url.AbsolutePath=="/test1"){ test1 o=new test1(); o.ProcessRequest(Context); o.RenderControl(writer); writer.Flush(); writer.Close(); Response.Flush(); // Response.Write(writer.ToString()); }else{ Response.ContentType="text/plain"; Response.Write("Hi world!"); } CompleteRequest(); }
/ static / bit works just like hi world. However, I cannot use the /test1
route. It reaches this point, but everything that is displayed is a black page.
I have a test1.aspx page with this designer content:
<%@ Page Language="C#" Inherits="namespace.test1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>test1</title> </head> <body> <form id="form1"> </form> <form id="form2"> <input type="text" id="test1" /> </form> </body> </html>
and it has almost no code (just an empty function that doesn't matter)
What am I doing wrong here?
Earlz
source share