473,386 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Common ASPX to Virtual Folder?

I have several ASPX pages (with code-behind logic) that I reuse amongst many
Web sites on the same production server. Currently each Web site has its own
copy of these aspx pages. I was thinking that it might be a good idea to
move these common aspx pages to a new folder and then make them accessible
via a new virtual directory in each Web site. Is this a good idea? Bad idea?
Thoughts, opinions?

Thanks!
Nov 19 '05 #1
7 2331
If they are extremely basic pages (pretty much static html) then this could
work.
Otherwise it might be better to make them into custom controls.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"J Smithers" <A@B.COM> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
I have several ASPX pages (with code-behind logic) that I reuse amongst
many Web sites on the same production server. Currently each Web site has
its own copy of these aspx pages. I was thinking that it might be a good
idea to move these common aspx pages to a new folder and then make them
accessible via a new virtual directory in each Web site. Is this a good
idea? Bad idea? Thoughts, opinions?

Thanks!

Nov 19 '05 #2
If I make them into custom controls, then wouldn't I then have to place them
on other ASPX pages (pages I don't have now) in order for them to be
accessed? FWIW: these aren't just small HTML snippets that could go into
user controls. These are full-blown pages that hook into a middle tier, etc.

I really want to understand this. Lets take my first reused page -
Foo.aspx - and we convert it into a custom control. How would we open
Foo.aspx (as a custom control) from the menuing system or from other links?
Wouldn't I have to place it in a new page FooHoster.aspx - and load it in
the page_load event of FooHoster.aspx - or am I totally missing something
here? Or am I understanding this correctly and it is a standard and
recommended practice?

Thanks!!!!
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Of**************@TK2MSFTNGP10.phx.gbl...
If they are extremely basic pages (pretty much static html) then this
could work.
Otherwise it might be better to make them into custom controls.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"J Smithers" <A@B.COM> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
I have several ASPX pages (with code-behind logic) that I reuse amongst
many Web sites on the same production server. Currently each Web site has
its own copy of these aspx pages. I was thinking that it might be a good
idea to move these common aspx pages to a new folder and then make them
accessible via a new virtual directory in each Web site. Is this a good
idea? Bad idea? Thoughts, opinions?

Thanks!


Nov 19 '05 #3
Yes, you would have to drag a control onto a page. Is that difficult?
Seems like a small price to pay for efficient, object oriented code reuse.

Coversely, pages use code behinds, which compile into DLLs that are project
specific and tend to reference other files that are project specific... it
can get messy trying to share complex pages.

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


"J Smithers" <A@B.COM> wrote in message
news:uS**************@TK2MSFTNGP14.phx.gbl...
If I make them into custom controls, then wouldn't I then have to place
them on other ASPX pages (pages I don't have now) in order for them to be
accessed? FWIW: these aren't just small HTML snippets that could go into
user controls. These are full-blown pages that hook into a middle tier,
etc.

I really want to understand this. Lets take my first reused page -
Foo.aspx - and we convert it into a custom control. How would we open
Foo.aspx (as a custom control) from the menuing system or from other
links? Wouldn't I have to place it in a new page FooHoster.aspx - and load
it in the page_load event of FooHoster.aspx - or am I totally missing
something here? Or am I understanding this correctly and it is a standard
and recommended practice?

Thanks!!!!
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Of**************@TK2MSFTNGP10.phx.gbl...
If they are extremely basic pages (pretty much static html) then this
could work.
Otherwise it might be better to make them into custom controls.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"J Smithers" <A@B.COM> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
I have several ASPX pages (with code-behind logic) that I reuse amongst
many Web sites on the same production server. Currently each Web site has
its own copy of these aspx pages. I was thinking that it might be a good
idea to move these common aspx pages to a new folder and then make them
accessible via a new virtual directory in each Web site. Is this a good
idea? Bad idea? Thoughts, opinions?

Thanks!



Nov 19 '05 #4
"J Smithers" <A@B.COM> confessed in news:uS8v$52AFHA.3708
@TK2MSFTNGP14.phx.gbl:
If I make them into custom controls, then wouldn't I then have to place them on other ASPX pages (pages I don't have now) in order for them to be
accessed? FWIW: these aren't just small HTML snippets that could go into
user controls. These are full-blown pages that hook into a middle tier, etc.
I really want to understand this. Lets take my first reused page -
Foo.aspx - and we convert it into a custom control. How would we open P> Foo.aspx (as a custom control) from the menuing system or from other
links? Wouldn't I have to place it in a new page FooHoster.aspx - and load it in
the page_load event of FooHoster.aspx - or am I totally missing something
here? Or am I understanding this correctly and it is a standard and
recommended practice?

Thanks!!!!
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Of**************@TK2MSFTNGP10.phx.gbl...
If they are extremely basic pages (pretty much static html) then this
could work.
Otherwise it might be better to make them into custom controls.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"J Smithers" <A@B.COM> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
I have several ASPX pages (with code-behind logic) that I reuse amongst
many Web sites on the same production server. Currently each Web site hasits own copy of these aspx pages. I was thinking that it might be a good
idea to move these common aspx pages to a new folder and then make them
accessible via a new virtual directory in each Web site. Is this a good
idea? Bad idea? Thoughts, opinions?

Thanks!




Perhaps you are still thinking in the old ASP code model, where one
includes script on a page in a linear fashion? I've written lots of code
like this, in the ASP days.

It took me a while to get used to implementing my middle tier as classes,
and then using them in the codebehind of my view tier.

Is this what you're lookign for?

-- ipgrunt
Nov 19 '05 #5
<< Is that difficult? >>
Nope, but of course it can often be easy to do the wrong thing or create
complexity in one area while trying to reduce it in another (thus your
second paragraph, I believe). Thanks for confirming what I thought was the
case - I'm now just a bit further up the learning curve.

- JS
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ub**************@tk2msftngp13.phx.gbl...
Yes, you would have to drag a control onto a page. Is that difficult?
Seems like a small price to pay for efficient, object oriented code reuse.

Coversely, pages use code behinds, which compile into DLLs that are
project specific and tend to reference other files that are project
specific... it can get messy trying to share complex pages.

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


"J Smithers" <A@B.COM> wrote in message
news:uS**************@TK2MSFTNGP14.phx.gbl...
If I make them into custom controls, then wouldn't I then have to place
them on other ASPX pages (pages I don't have now) in order for them to be
accessed? FWIW: these aren't just small HTML snippets that could go into
user controls. These are full-blown pages that hook into a middle tier,
etc.

I really want to understand this. Lets take my first reused page -
Foo.aspx - and we convert it into a custom control. How would we open
Foo.aspx (as a custom control) from the menuing system or from other
links? Wouldn't I have to place it in a new page FooHoster.aspx - and
load it in the page_load event of FooHoster.aspx - or am I totally
missing something here? Or am I understanding this correctly and it is a
standard and recommended practice?

Thanks!!!!
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Of**************@TK2MSFTNGP10.phx.gbl...
If they are extremely basic pages (pretty much static html) then this
could work.
Otherwise it might be better to make them into custom controls.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"J Smithers" <A@B.COM> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
I have several ASPX pages (with code-behind logic) that I reuse amongst
many Web sites on the same production server. Currently each Web site
has its own copy of these aspx pages. I was thinking that it might be a
good idea to move these common aspx pages to a new folder and then make
them accessible via a new virtual directory in each Web site. Is this a
good idea? Bad idea? Thoughts, opinions?

Thanks!



Nov 19 '05 #6
<<Is this what you're lookign for?>>
Thanks, but not really. I've already separated everything out into tiers
(starting in the design phase) and I never really worked with classic ASP
beyond a "Hello World" page. New to the Web, but not OOP.
So, what I have is some non-trivial aspx pages (calling middle-tier for
everything but UI-specific functionality) using a home-grown templating
strategy (couldn't wait for 2.0 Master pages). Of course scope creep is
happening and now I have to duplicate this thing on one server. I was just
going through the app and looking for things (like common jpgs and css
files) to move out into a common folder structure accessible via virtual
directories (read-only) from each "copy" of this Web application. It
occurred to me that I could perhaps move some of the aspx pages off as
well - with Execute/script only permissions on the virtual directory. Thus
my OP. Just wondering if it makes sense.

Thanks again!

"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4...
"J Smithers" <A@B.COM> confessed in news:uS8v$52AFHA.3708
@TK2MSFTNGP14.phx.gbl:
If I make them into custom controls, then wouldn't I then have to place

them
on other ASPX pages (pages I don't have now) in order for them to be
accessed? FWIW: these aren't just small HTML snippets that could go into
user controls. These are full-blown pages that hook into a middle tier,

etc.

I really want to understand this. Lets take my first reused page -
Foo.aspx - and we convert it into a custom control. How would we open

P> Foo.aspx (as a custom control) from the menuing system or from other
links?
Wouldn't I have to place it in a new page FooHoster.aspx - and load it in
the page_load event of FooHoster.aspx - or am I totally missing something
here? Or am I understanding this correctly and it is a standard and
recommended practice?

Thanks!!!!
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:Of**************@TK2MSFTNGP10.phx.gbl...
If they are extremely basic pages (pretty much static html) then this
could work.
Otherwise it might be better to make them into custom controls.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"J Smithers" <A@B.COM> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
I have several ASPX pages (with code-behind logic) that I reuse amongst
many Web sites on the same production server. Currently each Web site hasits own copy of these aspx pages. I was thinking that it might be a good
idea to move these common aspx pages to a new folder and then make them
accessible via a new virtual directory in each Web site. Is this a good
idea? Bad idea? Thoughts, opinions?

Thanks!



Perhaps you are still thinking in the old ASP code model, where one
includes script on a page in a linear fashion? I've written lots of code
like this, in the ASP days.

It took me a while to get used to implementing my middle tier as classes,
and then using them in the codebehind of my view tier.

Is this what you're lookign for?

-- ipgrunt

Nov 19 '05 #7
"J Smithers" <A@B.COM> confessed in news:#RSVJe3AFHA.2196
@TK2MSFTNGP14.phx.gbl:
<<Is this what you're lookign for?>>
Thanks, but not really. I've already separated everything out into tiers
(starting in the design phase) and I never really worked with classic ASP
beyond a "Hello World" page. New to the Web, but not OOP.
So, what I have is some non-trivial aspx pages (calling middle-tier for
everything but UI-specific functionality) using a home-grown templating
strategy (couldn't wait for 2.0 Master pages). Of course scope creep is
happening and now I have to duplicate this thing on one server. I was just going through the app and looking for things (like common jpgs and css
files) to move out into a common folder structure accessible via virtual
directories (read-only) from each "copy" of this Web application. It
occurred to me that I could perhaps move some of the aspx pages off as
well - with Execute/script only permissions on the virtual directory. Thus my OP. Just wondering if it makes sense.

Thanks again!

Very Good, Mr. Smithers,

I too have wanted 'master pages' from the moment I realized they were
missing! I tried a simple solution with my own website that involves
extending the Page class. It works, but I still have unworkable issues and
besides, it's a real pain to have to create HTML bit by bit using
LiteralControl calls.

The other day I saw a solution that uses a clever search routine to parse
structures behind the page, looking for things like the header area, and
then has delegate interfaces to add specific items (to insert the same call
to a .css file, for instance). Clever, but clumsy workarounds for a feature
that at first, I couldn't believe were not there. UserControls just don't
hack it most of the time!

So, what I do is keep a library of template pages, and copy and paste what
I need with each new page I create. It is very labor intensive, but it is
simple and works. I'm just glad I'm not managing development groups right
now. That's where the real problems lie in standardizing code.

Good luck.

--ipgrunt

<Snip>
--
Nov 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: CW | last post by:
I just took an extensive ASP.NET course and copied my projects to my wwwroot folder and tried opening my default page which consumes some web service. It worked ok at the course but now I get this...
2
by: flat_ross | last post by:
Hi, I am in a shop where developers are required to work off of a network share. This is so that code is backed up nightly. So I am testing running an ASP.NET Web application with a Class...
11
by: ASP.NET User | last post by:
Hi I am in a shop where developers are required to work off of a networ share. This is so that code and other documentation is backed up nightly. This is outside the realm of Visual SourceSafe...
6
by: Gordo | last post by:
Hi, I have written a number of server controls to build the company's intranet from data held in an Oracle database. Everything works well for the various navigation pages. However, the...
2
by: Steve M | last post by:
I am having a really strange problem. I have a site setup in a virtual directory that fails with the error below. It works on other web servers that are network load balanced with this server. I...
3
by: dave | last post by:
I need to add additional .aspx pages to an existing web site. I was hoping to create a new web project in VS 2003, build the project, copy the .aspx files and the .dll into the virtual directory...
1
by: Neal | last post by:
Hi All, I have deployed a web site to a hosting site (ix), but some really strange incomplete execution hassles. The app is Frameset based, 2 of the aspx pages for 2 of the 4 frames, don't...
18
by: Boris Yeltsin | last post by:
I'm using a Web Deployment Project under Visual Studio 2005. What I would love to be able to deploy to a fresh server is just the \bin folder and the web.config (and perhaps a couple of other...
3
by: =?Utf-8?B?TWlrZQ==?= | last post by:
I have an asp.net 2.0 web application that I have pre-compiled and deployed to a Windows 2003 server. When I try to access the web application I get the following message in my browser: 'The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.