By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 2,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Custom Http Handler Question

P: n/a
I have a custom http handler set for an ASP.NET site which handles requests for ".scef" pages. It
works fine once IIS is properly configured.

I've noticed something about the handler, though, that I want to confirm. Let's say my site has a
"virtual" page that the handler should generate called www.scef.us/test2.scef. If I enter that
address in the address bar of a browser -- and the site's ASP.NET process isn't running (it's not a
heavily-trafficed site) -- I get a server application error.

But if I first visit a "normal" page in the site -- say the home page, which is a plain aspx page --
then visiting the virtual page works fine.

It's as is asking for the virtual page doesn't cause the site's process to start. At least, that's
my theory.

Is this theory correct? If so, how do I code an http handler so that it will start up the site
process? If the theory's not correct, what other things might be causing this behavior?

Thanx in advance!

- Mark
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
How do you configre IIS - map the extension to the aspnet ISAPI?

--
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
<Mark Olbert> wrote in message
news:ta********************************@4ax.com...
I have a custom http handler set for an ASP.NET site which handles requests
for ".scef" pages. It
works fine once IIS is properly configured.

I've noticed something about the handler, though, that I want to confirm.
Let's say my site has a
"virtual" page that the handler should generate called
www.scef.us/test2.scef. If I enter that
address in the address bar of a browser -- and the site's ASP.NET process
isn't running (it's not a
heavily-trafficed site) -- I get a server application error.

But if I first visit a "normal" page in the site -- say the home page,
which is a plain aspx page --
then visiting the virtual page works fine.

It's as is asking for the virtual page doesn't cause the site's process to
start. At least, that's
my theory.

Is this theory correct? If so, how do I code an http handler so that it
will start up the site
process? If the theory's not correct, what other things might be causing
this behavior?

Thanx in advance!

- Mark

Nov 19 '05 #2

P: n/a
I don't remember; it's been a while. I did it whichever way the documentation suggested.

I was able to fix the problem. It turns out a custom handler can be called when there is no running
HttpApplication instance. Since my handler was (initially) using some properties and methods of
Global.asax to manipulate a database connection, it would blow up in that situation. I solved the
problem by including standalone logic that does not depend on the existence of an HttpApplication
instance within the custom handler.

- Mark

On Mon, 17 Jan 2005 13:16:18 +0100, "Daniel Fisher\(lennybacon\)" <info@(removethis)lennybacon.com>
wrote:
How do you configre IIS - map the extension to the aspnet ISAPI?


Nov 19 '05 #3

P: n/a
That is the right way :-)

--
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
<Mark Olbert> wrote in message
news:8n********************************@4ax.com...
I don't remember; it's been a while. I did it whichever way the
documentation suggested.

I was able to fix the problem. It turns out a custom handler can be called
when there is no running
HttpApplication instance. Since my handler was (initially) using some
properties and methods of
Global.asax to manipulate a database connection, it would blow up in that
situation. I solved the
problem by including standalone logic that does not depend on the
existence of an HttpApplication
instance within the custom handler.

- Mark

On Mon, 17 Jan 2005 13:16:18 +0100, "Daniel Fisher\(lennybacon\)"
<info@(removethis)lennybacon.com>
wrote:
How do you configre IIS - map the extension to the aspnet ISAPI?

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.