Hi,
Is there any way that we can map a path to a aspx file at a different
location?
In essence, I need to make different http addresses to point ot he same
aspx file - for example,
http://server/webprj/abc/index.aspx
http://server/webprj/def/index.aspx
to point ot the same aspx file (say at /webprj/index.aspx)
I'm planning to apply different skin (style) on different folders, but
want to keep the aspx file in one place - so I don't have to edit 10
different index.aspx file when a change is required.
I have thought about
1) virtual folders in IIS, and
2) keeping same aspx files with same code-behind
but want to find out if there is a neater way to solve this issue.We think virtual folders in IIS is actually a neat way. Remember, if you wan
t
to point directly to a subfolder in your web application, you'll need to
create a bin folder in that subfolder, to avoid a 'Could not load type
"'MyType'." error.
Kind regards,
Nikander & Margriet Bruggeman
"Samuel Kim" wrote:
> Hi,
> Is there any way that we can map a path to a aspx file at a different
> location?
> In essence, I need to make different http addresses to point ot he same
> aspx file - for example,
> http://server/webprj/abc/index.aspx
> http://server/webprj/def/index.aspx
> to point ot the same aspx file (say at /webprj/index.aspx)
> I'm planning to apply different skin (style) on different folders, but
> want to keep the aspx file in one place - so I don't have to edit 10
> different index.aspx file when a change is required.
> I have thought about
> 1) virtual folders in IIS, and
> 2) keeping same aspx files with same code-behind
> but want to find out if there is a neater way to solve this issue.
>
You could either duplicate the files and define a different "master
page" (using some kind of master pages solution).
You could also dynamically change the "master page" or css based on a
part of the requested url. In that case you could use a rewrite engine
(either google for one or roll your own, its quite trivial) to define
the mappings for urls to files (also refered to as "url rewriting").
You can then write some logic which checks what the requested url is,
and use this to load the correct master page/css/whatever.
HTH.
Hello Samuel,
You could look at using URL rewriting [1] do map your request to something
like:
http://server/webprj/index.aspx?skin=abc
[1] http://msdn.microsoft.com/asp.net/d...rlrewriting.asp
Matt Berther
http://www.mattberther.com
> Hi,
> Is there any way that we can map a path to a aspx file at a different
> location?
> In essence, I need to make different http addresses to point ot he
> same
> aspx file - for example,
> http://server/webprj/abc/index.aspx
> http://server/webprj/def/index.aspx
> to point ot the same aspx file (say at /webprj/index.aspx)
> I'm planning to apply different skin (style) on different folders, but
> want to keep the aspx file in one place - so I don't have to edit 10
> different index.aspx file when a change is required.
> I have thought about
> 1) virtual folders in IIS, and
> 2) keeping same aspx files with same code-behind
> but want to find out if there is a neater way to solve this issue.
>
0 comments:
Post a Comment