cookieless Session and httpHandler configuration

  • Thread starter Michael Schwarz
  • Start date
M

Michael Schwarz

Hi,

I have a own HttpHandler running and configured like this in my web.config:

<add verb="*" path="subfolder/*.ashx" type="Class,Assembly"/>

Now, when turning cookieless Sessions on my HttpHandler is not working,
instead my second HttpHandler is invoked, which is configured for *.ashx
files.

How can I get the first one running if cookieless Sessions are enabled?

Regards,
Michael
 
S

Steven Cheng[MSFT]

Hi Michael,

Welcome to the ASP.NET newsgroup.

From your description, you're configuring a custom httphandler to process
the requests to a given extension in a sub directory in the application.
However, you found the handler not work when the application is using
cookieless session(uri based) ,correct?

Based on my experience, for configuring httphandler for sub directory, we
should use a web.config in that certain sub dir or the <location>
configuration element rather than embeded the directory path into the
httphandler path. for example:

the following web.config use a <location> element to configure the
httphandler to serve requests to that sub dir:

===============
<configuration>
..............

<location path="Navigation">
<system.web>
<httpHandlers >
<add verb="*" path="Report.ashx" type="ReportHandler, __code"/>
</httpHandlers>
</system.web>
</location>
</configuration>

Here is the detailed description on using the <location> element to perform
hierarchical configuration:

#How to: Configure Specific Directories Using Location Settings
http://msdn2.microsoft.com/en-us/library/ms178692(vs.80).aspx

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



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

Michael Schwarz

Steven Cheng said:
Hi Michael,

Welcome to the ASP.NET newsgroup.

From your description, you're configuring a custom httphandler to process
the requests to a given extension in a sub directory in the application.
However, you found the handler not work when the application is using
cookieless session(uri based) ,correct?

Based on my experience, for configuring httphandler for sub directory, we
should use a web.config in that certain sub dir or the <location>
configuration element rather than embeded the directory path into the
httphandler path. for example:

the following web.config use a <location> element to configure the
httphandler to serve requests to that sub dir:

===============
<configuration>
.............

<location path="Navigation">
<system.web>
<httpHandlers >
<add verb="*" path="Report.ashx" type="ReportHandler, __code"/>
</httpHandlers>
</system.web>
</location>
</configuration>

Here is the detailed description on using the <location> element to
perform
hierarchical configuration:


Great, this is working!!! Thanks Steven

Regards,
Michael
 
S

Steven Cheng[MSFT]

You're welcome Michael,

Have a good day!

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



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

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

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top