As is often the case the error is in how you are calling the code above, not in the code above, so without seeing more of your page it is impossible to answer the question.
Wherever the bit of code that calls AddThumb() is, you need to move that code to Page_Init().
/- Sam Judson : Wrox Technical Editor -/
|