Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Determine Page Type

Reply
Thread Tools

Determine Page Type

 
 
Jonathan Wood
Guest
Posts: n/a
 
      06-03-2008
Okay, so I created a generic IHttpModule class to globally intercept
Page_Init in order to set the page's theme based on the user's database
settings.

I have this working except one problem: I have some help pages, in a
separate folder, that use a separate style sheet. Is there any way to detect
these pages in my handler and not set the theme for these pages?

Thanks.

Jonathan

 
Reply With Quote
 
 
 
 
Microsoft Newsserver
Guest
Posts: n/a
 
      06-03-2008
I would be interested in your final solution to this.

regards


"Jonathan Wood" <> wrote in message
news:%...
> Okay, so I created a generic IHttpModule class to globally intercept
> Page_Init in order to set the page's theme based on the user's database
> settings.
>
> I have this working except one problem: I have some help pages, in a
> separate folder, that use a separate style sheet. Is there any way to
> detect these pages in my handler and not set the theme for these pages?
>
> Thanks.
>
> Jonathan
>



 
Reply With Quote
 
 
 
 
Munna
Guest
Posts: n/a
 
      06-03-2008
On Jun 3, 11:59 am, "Jonathan Wood" <jw...@softcircuits.com> wrote:
> Okay, so I created a generic IHttpModule class to globally intercept
> Page_Init in order to set the page's theme based on the user's database
> settings.
>
> I have this working except one problem: I have some help pages, in a
> separate folder, that use a separate style sheet. Is there any way to detect
> these pages in my handler and not set the theme for these pages?
>
> Thanks.
>
> Jonathan


Hi

you can use a simple trick
use
context.Request.FilePath of HttpContext to get the path
and check wheither it is in your help path...
and perform your operation

private void Application_BeginRequest(Object source,
EventArgs e)
{
// Create HttpApplication and HttpContext objects to
access
// request and response properties.
HttpApplication application = (HttpApplication)source;
HttpContext context = application.Context;
string filePath = context.Request.FilePath;
if (filePath.Contains("Help"))
{
//do some thing
}
}

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
 
Reply With Quote
 
Jonathan Wood
Guest
Posts: n/a
 
      06-03-2008
Okay. I actually set a hook for Page_PreInit so I don't have the
BeginRequest arguments at that time. But
HttpContext.Current.Request.FilePath seems to work just fine.

Not sure if that is the most efficient solution but it certainly seems to
work.

Thanks!

Jonathan

"Munna" <> wrote in message
news:7cede60c-2845-49ea-83cc-...
> On Jun 3, 11:59 am, "Jonathan Wood" <jw...@softcircuits.com> wrote:
>> Okay, so I created a generic IHttpModule class to globally intercept
>> Page_Init in order to set the page's theme based on the user's database
>> settings.
>>
>> I have this working except one problem: I have some help pages, in a
>> separate folder, that use a separate style sheet. Is there any way to
>> detect
>> these pages in my handler and not set the theme for these pages?
>>
>> Thanks.
>>
>> Jonathan

>
> Hi
>
> you can use a simple trick
> use
> context.Request.FilePath of HttpContext to get the path
> and check wheither it is in your help path...
> and perform your operation
>
> private void Application_BeginRequest(Object source,
> EventArgs e)
> {
> // Create HttpApplication and HttpContext objects to
> access
> // request and response properties.
> HttpApplication application = (HttpApplication)source;
> HttpContext context = application.Context;
> string filePath = context.Request.FilePath;
> if (filePath.Contains("Help"))
> {
> //do some thing
> }
> }
>
> Best of luck
>
> Munna
> www.munna.shatkotha.com
> www.munna.shatkotha.com/blog
> www.shatkotha.com


 
Reply With Quote
 
Munna
Guest
Posts: n/a
 
      06-04-2008
Hi

I agree with you totally that its not the best solution perhaps, but
this works...

Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to determine type-type? Gernot Frisch C++ 3 01-13-2005 07:34 AM
Re: Type casting- a larger type to a smaller type pete C Programming 4 04-02-2004 05:19 PM
Re: Type casting- a larger type to a smaller type heyo C Programming 3 04-01-2004 06:35 PM
nuby: determine method passed and determine the receiver that received the method Peņa, Botp Ruby 1 01-24-2004 07:51 PM
How to determine the prior page (i.e. page the back button will go to) Rich Javascript 6 01-24-2004 05:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57