I'm using this code in my Global.asax to change master page:\[code\]method Global.Application_PreRequestHandlerExecute(src: System.Object; e: EventArgs);begin var p: System.Web.UI.Page := System.Web.UI.Page(self.Context.Handler); if p <> nil then p.PreInit += new EventHandler(page_PreInit)end;method Global.page_PreInit(sender: System.Object; e: EventArgs);var S: String;begin var p: System.Web.UI.Page := System.Web.UI.Page(self.Context.Handler); if p <> nil then if p.Master <> nil then begin if Request.Params['__EVENTTARGET'] <> nil then begin S := Request.Params['__EVENTTARGET']; if S.Length > 0 then S := S.Substring(S.IndexOf('$') + 1); if S = 'lbPrint' then Session['P'] := '1' else if S = 'lbNormal' then Session['P'] := '0'; if Session['P'].ToString = '1' then S := '/Print.Master' else S := '/Site.Master'; if not p.MasterPageFile.ToUpper.Equals(S.ToUpper) then p.MasterPageFile := S; end; end;end;\[/code\]Whenever this code is executed, viewstate of all controls in the content page is lost. So, I was wondering how to preserve them...