This implementation is: page mypage = (page) system.Web.httpContext.current.handler; string s = (string) mypage.viewstate ["wherever"];