HTTPModule(s)

G

Girish

Ive implemented a HTTPModule for my website. My problem is that my website
is divided into two sections. One graphical version and one text only
version. Both contain aspx files and the site is organized in a rather
complex way with the text only and graphical versions of the pages all
reside together in the same directory. My Httpmodule is implemented as a
preprocessor before the page gets handled.

Is there a way I can implement 2 httpmodules for both these versions of my
webiste somehow? The graphical versions will be "preprocessed" first by one
httpmodule and the text only versions will be "preprocessed" by another
httpmodule.

I obviously know which files are the graphical versions of the site and
which files are not. I really dont want to examine the filename and do
this.. is there some pattern I can use? What if I move all the text only
version files into one directory? would that help any? Would I still have to
examine the path in my httpmodules to figure out which is text only and
which is graphical?

Some other way of doing this?

Thanks,
Girish
 
J

John Saunders

Girish said:
Ive implemented a HTTPModule for my website. My problem is that my website
is divided into two sections. One graphical version and one text only
version. Both contain aspx files and the site is organized in a rather
complex way with the text only and graphical versions of the pages all
reside together in the same directory. My Httpmodule is implemented as a
preprocessor before the page gets handled.

Is there a way I can implement 2 httpmodules for both these versions of my
webiste somehow? The graphical versions will be "preprocessed" first by one
httpmodule and the text only versions will be "preprocessed" by another
httpmodule.

I obviously know which files are the graphical versions of the site and
which files are not. I really dont want to examine the filename and do
this.. is there some pattern I can use? What if I move all the text only
version files into one directory? would that help any? Would I still have to
examine the path in my httpmodules to figure out which is text only and
which is graphical?

Some other way of doing this?

If I were you, I'd put the different versions into different directories no
matter what. That way, you could even give both versions the same name:
g/page.aspx and t/page.aspx instead of page_g.aspx and page_t.aspx.

Have you looked into using only a single version which adapts itself based
on whether text-only is wanted? The ASP.NET Mobile Controls technology
adapts to far greater differences in output formats, so I'd think one could
do the same with text-only versus graphical.
 
G

Girish

Thanks for your answer. I will still have the same problem with HTTPModules
tho.

I need two modules and somehow need to configure them to only process
specific directories within a web application.

Girish
 
J

John Saunders

Girish said:
Thanks for your answer. I will still have the same problem with HTTPModules
tho.

I need two modules and somehow need to configure them to only process
specific directories within a web application.

If both directories require the same processing, then you could use the same
HTTPModule for both. If they require different but very similar processing
then you could use the same HTTPModule for both, but configure it
differently for each directory.

Only if they require separate processing which is substantially different
between the two directories would you need two separate HTTPModules.
 
G

Girish

If they require different but very similar processing
then you could use the same HTTPModule for both, but configure it
differently for each directory.

Q. How do I cofigure one HTTPModule for different directories? Examine the
path for every request?

Thanks,
Girish
 
G

Girish

Dang.. seems like it would be a performance hit.. string parsing and all for
every request... :-(

girish
 
S

Steven Cheng[MSFT]

Hi Girish,

Yes, complex string parsing and manipulation will cause performance issue.
And generally we can make use of the Regular expression when dealing with
string operations. Here are two tech articles on using regular expressions
in dotnet.

#URL Rewriting in ASP.NET
http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/ht
ml/urlrewriting.asp

#Regular Expressions in ASP.NET
http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/ht
ml/regexnet.asp

Hope helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top