Re: Httphandler for asp files
- From: RahulH <RahulH@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Dec 2005 11:36:04 -0800
Hello Dominic,
The DefaultHttpHandler do not make call to the .asp file. I have written my
code below. Any suggesstions?
Thanks,
Rahul
"RahulH" wrote:
> Hello Dominic,
> I was trying out on 2.0 Development server and so was facing the problem. I
> published to IIS and it is solved.
> However, I am not getting the desired output. The .asp file is not called.
> I am writing my code below which can be helpful for you to guide me more
> accurately.
> web.config:
> <httpHandlers>
> <add verb="*" path="*.asp" type="SampleHandler, App_Code" />
> <add path="*.asp" verb="GET,HEAD,POST"
> type="System.Web.DefaultHttpHandler" />
> </httpHandlers>
>
> SampleHnadler.cs
> public class SampleHandler: IHttpHandler
> {
> public void ProcessRequest(HttpContext context)
> {
> try
> {
> bool status = false;
> if (accessIDs.Length != 0)
> {
> /* Code to authenticate */
> if (status == false)
> {
>
> context.Response.Redirect("Default.aspx?NoAccess=1");
> }
> else
> {
> //user has access and .asp file should be
> rendered.
> }
> }
> else
> {
>
> context.Response.Redirect("Default.aspx?NoAccessLevelProvided=1");
> }
> }
> catch (Exception e)
> {
> context.Response.Write(e.Message);
> }
> }
>
> public bool IsReusable
> {
> get
> {
> return false;
> }
> }
> }
>
> Also I have set .Net 2.0 dll in wildcard script maps.
>
> Thanks,
> Rahul.
>
> "Dominick Baier [DevelopMentor]" wrote:
>
> > Hello RahulH,
> >
> > is the .asp web service extension enabled in IIS ?
> >
> > ---------------------------------------
> > Dominick Baier - DevelopMentor
> > http://www.leastprivilege.com
> >
> > > Hello Dominic,
> > > Thanks for your information and time.
> > > I created an handler in 2.0 derived from DefaultHttpHandler but I get
> > > error
> > > saying "The type of page you have requested is not served because it
> > > has been
> > > explicitly forbidden. The extension '.asp' may be incorrect. Please
> > > review
> > > the URL below and make sure that it is spelled correctly"
> > > I tried adding remove element under httpHandlers, but it did not help.
> > > Any idea why I am facing the problem?
> > > Thanks,
> > > Rahul
> > > "Dominick Baier [DevelopMentor]" wrote:
> > >
> > >> Hello RahulH,
> > >>
> > >> you mentioned the "Membership component" - so i assumed you are
> > >> talking about 2.0
> > >>
> > >> in 1.1 this is not possible...AFAIK
> > >>
> > >> ---------------------------------------
> > >> Dominick Baier - DevelopMentor
> > >> http://www.leastprivilege.com
> > >>> Hey Dominic,
> > >>> Thanks, this is the last option as I will have to move to 2.0
> > >>> environment.
> > >>> But wanted to check if this can be somehow achieved in 1.1
> > >>> Thanks again.
> > >>> -Rahul
> > >>> "Dominick Baier [DevelopMentor]" wrote:
> > >>>
> > >>>> Hello RahulH,
> > >>>>
> > >>>> this works in ASP.NET 2.0
> > >>>>
> > >>>> have a look here:
> > >>>> http://www.leastprivilege.com/ProtectingNonASPNETResourcesWithASPNE
> > >>>> T2
> > >>>> 0.aspx
> > >>>> ---------------------------------------
> > >>>> Dominick Baier - DevelopMentor
> > >>>> http://www.leastprivilege.com
> > >>>>> Hi,
> > >>>>> I have a .Net application wherein I use Membership component for
> > >>>>> authentication & authorize. Users can be redirected to an asp
> > >>>>> application. I
> > >>>>> want to authenticate this request and so tried an httphandler
> > >>>>> which
> > >>>>> authenticates the User.
> > >>>>> For this I have added .Net dll in wildcard application maps.
> > >>>>> After processing the handler the IIS does not treats the asp
> > >>>>> request
> > >>>>> as a
> > >>>>> normal asp file. Do I need to add anything to code for this?
> > >>>>> I hope I am clear enough in stating my problem.
> > >>>>> Thanks in advance,
> >
> >
> >
.
- Follow-Ups:
- Re: Httphandler for asp files
- From: Dominick Baier [DevelopMentor]
- Re: Httphandler for asp files
- References:
- Re: Httphandler for asp files
- From: RahulH
- Re: Httphandler for asp files
- Prev by Date: Re: Web App Security and MSIE Settings
- Next by Date: Re: Httphandler for asp files
- Previous by thread: Re: Httphandler for asp files
- Next by thread: Re: Httphandler for asp files
- Index(es):