How can I add/remove an HttpHandler in code (not in web.config)? 10 1797
set the target to null or unchain it using the -= syntax. setting to null
removes all registered listeners by the way
--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message
news:OZ******** *****@TK2MSFTNG P12.phx.gbl... How can I add/remove an HttpHandler in code (not in web.config)?
no, you didn't understand me :)
I want this:
<httpHandlers >
<add type="MyClass, MyAssembly" path="*.asmx" verb="*" />
</httpHandlers>
but in code. I'm hosting ASP.NET in my program, not in IIS, and I don't want
to use web.config
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag
news:up******** ******@TK2MSFTN GP12.phx.gbl... set the target to null or unchain it using the -= syntax. setting to null removes all registered listeners by the way
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:OZ******** *****@TK2MSFTNG P12.phx.gbl... How can I add/remove an HttpHandler in code (not in web.config)?
I may be wrong but I don't think this is possible. Handlers are responsible
for servicing the request, i'm not sure how you can adjust this on the fly
and still have it work.
--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message
news:On******** ******@TK2MSFTN GP14.phx.gbl... no, you didn't understand me :)
I want this: <httpHandlers > <add type="MyClass, MyAssembly" path="*.asmx" verb="*" /> </httpHandlers>
but in code. I'm hosting ASP.NET in my program, not in IIS, and I don't want to use web.config
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:up******** ******@TK2MSFTN GP12.phx.gbl... set the target to null or unchain it using the -= syntax. setting to null removes all registered listeners by the way
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:OZ******** *****@TK2MSFTNG P12.phx.gbl... How can I add/remove an HttpHandler in code (not in web.config)?
why not? If I change httpHandlers in web.config they will be change on the
fly. Or am I wrong?
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag
news:Op******** ******@TK2MSFTN GP10.phx.gbl... I may be wrong but I don't think this is possible. Handlers are responsible for servicing the request, i'm not sure how you can adjust this on the fly and still have it work.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:On******** ******@TK2MSFTN GP14.phx.gbl... no, you didn't understand me :)
I want this: <httpHandlers > <add type="MyClass, MyAssembly" path="*.asmx" verb="*" /> </httpHandlers>
but in code. I'm hosting ASP.NET in my program, not in IIS, and I don't want to use web.config
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:up******** ******@TK2MSFTN GP12.phx.gbl... set the target to null or unchain it using the -= syntax. setting to null removes all registered listeners by the way
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:OZ******** *****@TK2MSFTNG P12.phx.gbl... How can I add/remove an HttpHandler in code (not in web.config)?
Yes, any modifications to web.config are picked up on the next request. Beware
that to make this happen, ASP.NET restartes your application (AppDomain)
and thus any in memory state will be lost (think InProc SessionState, Application
state and static/shared vairables).
-Brock
DevelopMentor http://staff.develop.com/ballen why not? If I change httpHandlers in web.config they will be change on the fly. Or am I wrong?
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:Op******** ******@TK2MSFTN GP10.phx.gbl...
I may be wrong but I don't think this is possible. Handlers are responsible for servicing the request, i'm not sure how you can adjust this on the fly and still have it work.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________ "Daniel Danilin" <ne*******@web. de> wrote in message news:On******** ******@TK2MSFTN GP14.phx.gbl...
no, you didn't understand me :)
I want this: <httpHandlers > <add type="MyClass, MyAssembly" path="*.asmx" verb="*" /> </httpHandlers> but in code. I'm hosting ASP.NET in my program, not in IIS, and I don't want to use web.config
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:up******** ******@TK2MSFTN GP12.phx.gbl...
set the target to null or unchain it using the -= syntax. setting to null removes all registered listeners by the way
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________ "Daniel Danilin" <ne*******@web. de> wrote in message news:OZ******** *****@TK2MSFTNG P12.phx.gbl...
> How can I add/remove an HttpHandler in code (not in web.config)? >
They are not changed on the fly. A change to the web config causes an
immediate restart of the application object so that the next request is
served from a newly created object that now has the registered httphandler.
I suppose you can always use an xml parser object to write to the web config
file, the outcome would be what you bargained for.
--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message
news:ON******** ******@TK2MSFTN GP14.phx.gbl... why not? If I change httpHandlers in web.config they will be change on the fly. Or am I wrong?
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:Op******** ******@TK2MSFTN GP10.phx.gbl...I may be wrong but I don't think this is possible. Handlers are responsible for servicing the request, i'm not sure how you can adjust this on the fly and still have it work.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:On******** ******@TK2MSFTN GP14.phx.gbl... no, you didn't understand me :)
I want this: <httpHandlers > <add type="MyClass, MyAssembly" path="*.asmx" verb="*" /> </httpHandlers>
but in code. I'm hosting ASP.NET in my program, not in IIS, and I don't want to use web.config
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:up******** ******@TK2MSFTN GP12.phx.gbl... set the target to null or unchain it using the -= syntax. setting to null removes all registered listeners by the way
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:OZ******** *****@TK2MSFTNG P12.phx.gbl... > How can I add/remove an HttpHandler in code (not in web.config)? >
The problem is, that Cassini server not uses web.config (or not always). So
I need to add httpHandlers in code.
I don't want that client can change config file
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag
news:O2******** *****@TK2MSFTNG P09.phx.gbl... They are not changed on the fly. A change to the web config causes an immediate restart of the application object so that the next request is served from a newly created object that now has the registered httphandler. I suppose you can always use an xml parser object to write to the web config file, the outcome would be what you bargained for.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:ON******** ******@TK2MSFTN GP14.phx.gbl... why not? If I change httpHandlers in web.config they will be change on the fly. Or am I wrong?
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:Op******** ******@TK2MSFTN GP10.phx.gbl...I may be wrong but I don't think this is possible. Handlers are responsibl e for servicing the request, i'm not sure how you can adjust this on the fly and still have it work.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:On******** ******@TK2MSFTN GP14.phx.gbl... no, you didn't understand me :)
I want this: <httpHandlers > <add type="MyClass, MyAssembly" path="*.asmx" verb="*" /> </httpHandlers>
but in code. I'm hosting ASP.NET in my program, not in IIS, and I don't want to use web.config
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:up******** ******@TK2MSFTN GP12.phx.gbl... > set the target to null or unchain it using the -= syntax. setting to > null removes all registered listeners by the way > > -- > Regards, > Alvin Bruney > [Shameless Author Plug] > The Microsoft Office Web Components Black Book with .NET > available at www.lulu.com/owc > _______________ __________ > > > "Daniel Danilin" <ne*******@web. de> wrote in message > news:OZ******** *****@TK2MSFTNG P12.phx.gbl... >> How can I add/remove an HttpHandler in code (not in web.config)? >> > >
No, the client won't change the config file. The server side code would
change it. I'll note that this is a hack and probably will result in
unmaintenable code.
--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message
news:O0******** ******@TK2MSFTN GP14.phx.gbl... The problem is, that Cassini server not uses web.config (or not always). So I need to add httpHandlers in code. I don't want that client can change config file
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:O2******** *****@TK2MSFTNG P09.phx.gbl... They are not changed on the fly. A change to the web config causes an immediate restart of the application object so that the next request is served from a newly created object that now has the registered httphandler. I suppose you can always use an xml parser object to write to the web config file, the outcome would be what you bargained for.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:ON******** ******@TK2MSFTN GP14.phx.gbl... why not? If I change httpHandlers in web.config they will be change on the fly. Or am I wrong?
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:Op******** ******@TK2MSFTN GP10.phx.gbl... I may be wrong but I don't think this is possible. Handlers are responsib le for servicing the request, i'm not sure how you can adjust this on the fly and still have it work.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:On******** ******@TK2MSFTN GP14.phx.gbl... > no, you didn't understand me :) > > I want this: > <httpHandlers > > <add type="MyClass, MyAssembly" path="*.asmx" verb="*" /> > </httpHandlers> > > but in code. I'm hosting ASP.NET in my program, not in IIS, and I > don't want to use web.config > > > "Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag > news:up******** ******@TK2MSFTN GP12.phx.gbl... >> set the target to null or unchain it using the -= syntax. setting to >> null removes all registered listeners by the way >> >> -- >> Regards, >> Alvin Bruney >> [Shameless Author Plug] >> The Microsoft Office Web Components Black Book with .NET >> available at www.lulu.com/owc >> _______________ __________ >> >> >> "Daniel Danilin" <ne*******@web. de> wrote in message >> news:OZ******** *****@TK2MSFTNG P12.phx.gbl... >>> How can I add/remove an HttpHandler in code (not in web.config)? >>> >> >> > >
I'm writing P2P using Web Services. So I can't use IIS and any config files.
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag
news:%2******** *******@TK2MSFT NGP09.phx.gbl.. . No, the client won't change the config file. The server side code would change it. I'll note that this is a hack and probably will result in unmaintenable code.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:O0******** ******@TK2MSFTN GP14.phx.gbl... The problem is, that Cassini server not uses web.config (or not always). So I need to add httpHandlers in code. I don't want that client can change config file
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:O2******** *****@TK2MSFTNG P09.phx.gbl... They are not changed on the fly. A change to the web config causes an immediate restart of the application object so that the next request is served from a newly created object that now has the registered httphandler. I suppose you can always use an xml parser object to write to the web config file, the outcome would be what you bargained for.
-- Regards, Alvin Bruney [Shameless Author Plug] The Microsoft Office Web Components Black Book with .NET available at www.lulu.com/owc _______________ __________
"Daniel Danilin" <ne*******@web. de> wrote in message news:ON******** ******@TK2MSFTN GP14.phx.gbl... why not? If I change httpHandlers in web.config they will be change on the fly. Or am I wrong?
"Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im Newsbeitrag news:Op******** ******@TK2MSFTN GP10.phx.gbl... >I may be wrong but I don't think this is possible. Handlers are >responsibl e for servicing the request, i'm not sure how you can adjust >this on the fly and still have it work. > > -- > Regards, > Alvin Bruney > [Shameless Author Plug] > The Microsoft Office Web Components Black Book with .NET > available at www.lulu.com/owc > _______________ __________ > > > "Daniel Danilin" <ne*******@web. de> wrote in message > news:On******** ******@TK2MSFTN GP14.phx.gbl... >> no, you didn't understand me :) >> >> I want this: >> <httpHandlers > >> <add type="MyClass, MyAssembly" path="*.asmx" verb="*" /> >> </httpHandlers> >> >> but in code. I'm hosting ASP.NET in my program, not in IIS, and I >> don't want to use web.config >> >> >> "Alvin Bruney [ASP.NET MVP]" <www.lulu.com/owc> schrieb im >> Newsbeitrag news:up******** ******@TK2MSFTN GP12.phx.gbl... >>> set the target to null or unchain it using the -= syntax. setting to >>> null removes all registered listeners by the way >>> >>> -- >>> Regards, >>> Alvin Bruney >>> [Shameless Author Plug] >>> The Microsoft Office Web Components Black Book with .NET >>> available at www.lulu.com/owc >>> _______________ __________ >>> >>> >>> "Daniel Danilin" <ne*******@web. de> wrote in message >>> news:OZ******** *****@TK2MSFTNG P12.phx.gbl... >>>> How can I add/remove an HttpHandler in code (not in web.config)? >>>> >>> >>> >> >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Earl Teigrob |
last post by:
My company sells software and wants to provide downloadable product. Some of
these downloads will be full CD's of over 550M
I had everything working fine using Response.filewrite() but when we tested
it with large files, it blew up. (crashed the server, well documented
problem)
I can download a file just fine if I just point to the download file and let
IIS generate the download dialog (but with no security, of course)
|
by: Jed |
last post by:
I have written an HttpHandler which I invoke through an ashx page.
The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page.
Everything up to the redirect works fine, but I can't get the redirect to work.
If I do a ...
context.Response.Write("Hello World");
.... the HttpHandler works great and the browser loads the text fine,
but if I change it to ...
|
by: Igor K |
last post by:
Hi all,
I'm developing asp.net website. Most of the pages are aspx, but let's say,
some 10% are html. For this html pages i use httphandlers to intercept calls
and to perform some job on this pages.
Lately I need to access Session state in HttpHandler's code. This seems to
be the problem. I searched the internet for some solution, i always found
advice to dervie from IHttpHandler and that will do, but obivously not.
|
by: Adam |
last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have
developed the handler,
1. installed it into the gac
2. added it to the machine.config:
<httpHandlers>
<add verb="*" path="*.sgf" type="CustomExtensionHandler,
Extenders.CustomExtensionHandler, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=d831d925597c1031" validate="True"/>
</httpHandlers>
|
by: bryan |
last post by:
I've got a custom HttpHandler to process all requests for a given
extension. It gets invoked OK, but if I try to do a Server.Transfer I
get an HttpException. A Response.Redirect works, but I really need to
avoid the extra round-trip to the client.
I've tried Passing the page name, the full URL, and the instance of
the handler class to the Transfer method, but everything gets me the
same error 500.
Any help would be appreciated.
| |
by: the4man |
last post by:
Hi all!
I have an app that show images that are stored in SQL Server. To show
the images on screen, until now (with the "old" ASP), I use the
following code:
<img src="showimage.asp?id=20" />
And in "showimage.asp" (more or less, I write from memory)
|
by: zlf |
last post by:
Hello,
I try to use a custom HttpHandler to add something to session, then display
the original page.
public void ProcessRequest(HttpContext context)
{
context.Session = "test";
}
But, a empty page is rendered with this HttpHandler, should I add some
|
by: David |
last post by:
Hi,
I'm very new to ASP.NET. I have over 10 years of C++ experience in MFC
and Games programming etc, but web programming is something I have just
started.
Sorry for the rather silly question, but can someone explain what a
HTTPHandler is for?
I gather they can handle custom file extensions, but they seem to be
|
by: Author |
last post by:
I followed the example at http://support.microsoft.com/kb/308001/EN-US/
and created my own HttpHandler.
Here is the code:
using System.Web;
namespace MyNameSpace
{
public class SyncHttpHandler: IHttpHandler
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |