Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > whats the best way to?

Reply
Thread Tools

whats the best way to?

 
 
Guy Bradley
Guest
Posts: n/a
 
      08-05-2003
write one function (for navigation) and call it in multiple asp.net pages? -
i would use an include file as i do in asp but i gather this isnt the best
way of doing it...

suggestion? - thx in advance


 
Reply With Quote
 
 
 
 
Steve C. Orr, MCSD
Guest
Posts: n/a
 
      08-05-2003
Create a class. Instantiate it where you need it.
Another approach would be to create a user control or custom control. This
would likely be a better approach if common UI is involved.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net



"Guy Bradley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> write one function (for navigation) and call it in multiple asp.net

pages? -
> i would use an include file as i do in asp but i gather this isnt the best
> way of doing it...
>
> suggestion? - thx in advance
>
>



 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      08-05-2003
Yes, in fact, you can often create a static method of a class, so that it
isn't even necessary to instantiate the class to use the method.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

"Steve C. Orr, MCSD" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Create a class. Instantiate it where you need it.
> Another approach would be to create a user control or custom control.

This
> would likely be a better approach if common UI is involved.
>
> --
> I hope this helps,
> Steve C. Orr, MCSD
> http://Steve.Orr.net
>
>
>
> "Guy Bradley" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > write one function (for navigation) and call it in multiple asp.net

> pages? -
> > i would use an include file as i do in asp but i gather this isnt the

best
> > way of doing it...
> >
> > suggestion? - thx in advance
> >
> >

>
>



 
Reply With Quote
 
Jay Warmack, MCAD
Guest
Posts: n/a
 
      08-05-2003
Guy,

Since UI is involved (rather than just business logic), I would suggest
creating your own page object (inherit from Page) and then inherit all your
pages from this new page object (instead of Page). Then all the protected
and public methods and properties that you add to your page object will be
available to all or your descendant pages. This method even allows you to
add code to the page object's Page_Load event to 'hardwire' the execution of
your navigation methods so that you don't even write any navigation code at
all in the descendant pages. Starting to solve things this way is the
first step to thinking OO instead of Cut-and-Paste (or Include in this
case).

Jay Warmack, MCAD
..Net Consultant



"Guy Bradley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> write one function (for navigation) and call it in multiple asp.net

pages? -
> i would use an include file as i do in asp but i gather this isnt the best
> way of doing it...
>
> suggestion? - thx in advance
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: Whats the best way to take pictures of paintings? Scratch Computer Support 17 07-01-2005 09:22 PM
Whats the fastest and best way to send multiple print jobs to several laser printers on a network JOni Computer Support 4 05-19-2005 03:27 PM
Whats Best Way? Exclude some xml, turn other red if "low" kmunderwood@charter.net XML 1 03-22-2005 11:15 PM
TURNING CRAZY, is there a way to write it in a different way? whats wrong francisco lopez Javascript 2 12-31-2004 11:15 PM
whats the best way to do this? suzy ASP .Net 3 04-15-2004 10:26 AM



Advertisments