of course you will get that error , because page constructor called in a very early stage , and the button will bot be initialzed yet , even the Response object will not be ready !
instead you need to move the code to Page_Init , with some modifications to the paramters name to avoid the naming conflict as follows:
Code: protected void Page_init(object sender, EventArgs e)
{
btnTest.Click += delegate(object BtnSender, EventArgs Btne)
{
Response.Write("HI");
};
}