How to know application is asp.net or not

  • Thread starter Thread starter Jong-won Choi
  • Start date Start date
J

Jong-won Choi

Hi

I'm trying to write .net dll for asp.net applications and non asp.net
applications.

Is it possible knowing if the dll is used with asp.net or not at
runtime? A class in the dll should have two different initialization
based on that.

Cheers

Jong-won Choi
 
Hi,

You can use System.Web.HttpContext.Current. If web app calls your DLL
HttContext.Current will hold the current context other null. One
exception are DLL that not loading in ASP.NET process (Assemblies
register as COM+ server applications), those DLLs will return always
null for HttpContext.Current.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top