471,122 Members | 890 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 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 2200
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by CW | last post: by
6 posts views Thread by Gordo | last post: by
18 posts views Thread by Boris Yeltsin | last post: by

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.