Ask a Question related to ASP.NET General, Design and Development.
-
Karl Seguin #1
Re: Code Access to page
There are a couple methods....first you could make use of some application
events in global.asax such as Begin Request.
However, I would recommend creating your own class that inherits from
System.Web.UI.Page, and have all your aspx pages inherit from your class.
Index.aspx.vb -----> YourBasePage.vb ----> System.Web.UI.Page. Once done,
you can Override OnInit on System.Web.UI.Page in YourBasePage.vb to do
whatever you want...make sure to call mybase.OnInit() (or base.OnInit(); in
c#).
Check out: [url]http://www.devarticles.com/art/1/304/2[/url] for an example.
Karl
"Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
news:eix2sUfSDHA.1804@TK2MSFTNGP11.phx.gbl...control> Hey guys,
> I am about to start a project and i want to be able to have as muchglobal> over
> the project as i can in a OOP approach
>
> i am wondering if there is anyway i can run some code on every page of my
> application
> is there anyway to do this rather than passing the Page object into aapplication> function(class)
> ie
> on page load
> myclass.myfunction(page)
>
> the reason i am wanting to do this is because at a later stage i want to
> implement Page Visit statistics and maybe some other things
>
>
> ANy ideas on this how i can have code access to everypage in my>
> Thanks
>
>
Karl Seguin Guest
-
Access Code Log In Page
Here's what I'm attempting to do: I need to have a page that has a text box where someone can enter one word or a set numbers. Then when thye... -
Access 2002 PDFWriter VBA Code w/WinXP does not work like Access 2000
I am trying to print an Access 2002 report (Windows XP OS) as a PDF. I had success with Access 2000 in a Windows 2000 environment, but as soon as I... -
Newbie needs code pages for SQL Server 2000 access from asp.net page using vb.net
I am only trying to connect to a local host . I am on Windows 2000 Server with sql 2000 server. My error is the classic "SQL server does not... -
how to pass an access DB query onto *next* page? trouble with *next* and *previous* querystring code
Don;t see any sign of any paging code is your snippets normally take this form Set rso = Server.CreateObject("ADODB.Recordset") rso.PageSize =... -
Storing ASP code in a Access mdb memofield and insert it in a asp-page
"Chris Hohmann" <hohmannATyahooDOTcom> schreef in bericht news:eStRtmfPDHA.2480@tk2msftngp13.phx.gbl... -
Jos #2
Re: Code Access to page
Vincent V wrote:
Apart from Karl's solution, you might also put your code in> Hey guys,
> I am about to start a project and i want to be able to have as much
> control over
> the project as i can in a OOP approach
>
> i am wondering if there is anyway i can run some code on every page
> of my application
> is there anyway to do this rather than passing the Page object into a
> global function(class)
> ie
> on page load
> myclass.myfunction(page)
>
> the reason i am wanting to do this is because at a later stage i want
> to implement Page Visit statistics and maybe some other things
>
>
> ANy ideas on this how i can have code access to everypage in my
> application
>
> Thanks
a user control (ascx file). Then you can insert this user control in
every page that needs it. I have already used a user control before
for page statistics.
--
Jos Branders
Jos Guest
-
Vincent V #3
Re: Code Access to page
Hey where can i get some more info on this agregation?
and httpHandlers
Thanks
"Mike S" <mikes@n-o.sp-a.m.pac.odedodea.edu> wrote in message
news:Ofe6BZoSDHA.1556@TK2MSFTNGP10.phx.gbl...aplying> I would also reccomend using the Page Inheritance model--but only when it
> suits the functional requirement in question.
>
> I would reccomend:
> Using it for setting up business objects, loading relative controls,seperate> templates, etc. Something else that may help you organize your "BasePages"
> would be to create the functionality you are trying to acomplish insimple> objects and then assess them through agregation; this tends to keep the
> structure of your "BasePage" classes simpler and, therefore, easier to
> maintain.
>
> However, don't forget about the handy HttpHandlers and HttpModules; amy> and maintainable approach that could easily handle Page Visit Statistics.
>
> Mike
>
>
> "Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
> news:eix2sUfSDHA.1804@TK2MSFTNGP11.phx.gbl...> control> > Hey guys,
> > I am about to start a project and i want to be able to have as much> > over
> > the project as i can in a OOP approach
> >
> > i am wondering if there is anyway i can run some code on every page of> global> > application
> > is there anyway to do this rather than passing the Page object into a> application> > function(class)
> > ie
> > on page load
> > myclass.myfunction(page)
> >
> > the reason i am wanting to do this is because at a later stage i want to
> > implement Page Visit statistics and maybe some other things
> >
> >
> > ANy ideas on this how i can have code access to everypage in my>> >
> > Thanks
> >
> >
>
Vincent V Guest



Reply With Quote

