Monday, March 27, 2006

Stupid ASP.NET

Did you know that a Response.Write in the Page_Load gets rendered right at the top of your HTML markup? Right at the top! Meaning right before <HTML>. Isn't that cool!

Not only that, a Page.Controls.Add will place your control right at the bottom of your controls collection which means that it goes right after the closing </HTML>. Awesome!!

Want some more?!

OK. Now, to add a control so that it falls within the <FORM>...</FORM> (which is what everybody wants), we need to say Controls[1].Controls.Add(mycontrol).

Controls[1] will get you the reference to the <FORM> control and so on...

Right now Controls[1] works for me but, who knows...

No comments:

About Me

My photo
C/C++ Programmer doing CAD on Windows. Some web development experience. Bangalorean.

Blog Archive