473,773 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2346
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******** ******@TK2MSFTN GP09.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.ne t> wrote in message
news:Of******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP09.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******** ******@TK2MSFTN GP14.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.ne t> wrote in message
news:Of******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP09.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$52AFH A.3708
@TK2MSFTNGP14.p hx.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.ne t> wrote in message
news:Of******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP09.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.ne t> wrote in message
news:ub******** ******@tk2msftn gp13.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******** ******@TK2MSFTN GP14.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.ne t> wrote in message
news:Of******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP09.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$52AFH A.3708
@TK2MSFTNGP14.p hx.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.ne t> wrote in message
news:Of******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP09.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
accessibl e 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:#RSVJe3AFH A.2196
@TK2MSFTNGP14.p hx.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
1426
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 error: Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. ...
2
2650
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 assembly all on a shared drive. I have the solution working perfectly. However, I have run into a hiccup. In order to map IIS Virtual Dir to a network drive, you need
11
2325
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 which we also use for code control. The network drive is used as the working folder. This is a configuration this shop has used for 6 years and I do not see it changing any time soon So I am testing running an ASP.NET Web application with a Clas...
6
1855
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 content pages are in the main converted .htm pages with no code behind. The issue I have is that I wish to place a small navigation server control on each page. All works well if I compile the pages with the solution referencing the server control dll....
2
15486
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 can go right to the default.aspx right in the ISS Manager and right-click browse and the error still comes up. I re-copied the folder over from a working server and checked IIS and NTFS permissions and it all matches. I recreated the virtual...
3
1908
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 of the existing web site. The existing web site would have a page with a link to the new web pages. I am getting the error of "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This...
1
1275
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 render, yet when i check the "View Soiurce" the html and controls etc all seem to be there, .. and no errors being reported.... Deployment took the form of FTP'ing the necessary files (aspx) and dll's and
18
8366
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 support files). But essentially I don't want to have to deploy all the ASPXs, images, .js etc. Is there a way to achieve this? I seem to remember some sort of special ASP.NET marker file you could put in the application root which would tell it...
3
27035
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 file '/Customer/Login.aspx' has not been pre-compiled, and cannot be requested'. If I rename the folder containing the web app to something other than 'Customer' then it works! I have tried deleting the folder and recreating it but I get the same...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.