I think typeof(Page).IsInstanceOfType(HttpContext.Current.Handler) (or a similar test using IsSubclassOf) might be safer -- that fixed "two levels of derivation" looks potentially fragile. (We sometimes derive from a custom Web Form class rather than directly from Page.) Just a suggestion.
-- Ivan Towlson White Carbon -----Original Message----- From: Unmoderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Richard Blewett Sent: 16 July 2004 09:47 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Page or WebService? HttpContext.Current.Handler.GetType().BaseType.BaseType == typeof(System.Web.UI.Page) =================================== This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
