Hi all,
I'm still learning asp.net so this may seem a simple question, but
here goes anyway. I have a generic function that I wish to access
from all pages in my web application. Intead of putting this
function into the code-behind of every page, is there somewhere I can
put it so that it can access it from all pages? I tried doing it the
same way that I create a class with a namespace etc.. but that didin't
work. I tried placing it in the global.asax but that didn't work
either.
Any help would be appreciated
Thanks
Renecreate a generic page with this function, then inherit from it for all your
other pages, that's what we do with great sucess.
--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"wrecker" <wrecker@.wrecked.com> wrote in message
news:2saf40dgrel9e3nqbg4ipahoeh33hkp01t@.4ax.com...
> Hi all,
> I'm still learning asp.net so this may seem a simple question, but
> here goes anyway. I have a generic function that I wish to access
> from all pages in my web application. Intead of putting this
> function into the code-behind of every page, is there somewhere I can
> put it so that it can access it from all pages? I tried doing it the
> same way that I create a class with a namespace etc.. but that didin't
> work. I tried placing it in the global.asax but that didn't work
> either.
> Any help would be appreciated
> Thanks
> Rene
Well, you could always give your global.asax a classname. The you can add
methods etc to it as you would any other class and they would be available
to the code base.
--
Regards
John Timney
Microsoft Regional Director
Microsoft MVP
"wrecker" <wrecker@.wrecked.com> wrote in message
news:2saf40dgrel9e3nqbg4ipahoeh33hkp01t@.4ax.com...
> Hi all,
> I'm still learning asp.net so this may seem a simple question, but
> here goes anyway. I have a generic function that I wish to access
> from all pages in my web application. Intead of putting this
> function into the code-behind of every page, is there somewhere I can
> put it so that it can access it from all pages? I tried doing it the
> same way that I create a class with a namespace etc.. but that didin't
> work. I tried placing it in the global.asax but that didn't work
> either.
> Any help would be appreciated
> Thanks
> Rene
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment