Put the code that you have written for generating upload control in pageInit method like below
private void Page_Init(object sender, EventArgs e)
{
}
There is no need for any activation....just copy paste it in the .cs codebehind file.... Hope this helps