Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

I am Jalpesh Vadgama a Microsoft MVP for Visual C# and BrainBench Certified ASP.NET Developer having more then 6 years of experience in .NET Technology.
Browse by Tags · View All
#ASP.NET 88
#DOTNET 87
BRH 79
ASP.NET 72
#.NET 52
C#.NET 48
DOTNET 44
ASP.NET 4.0 31
ASP.NET MVC 29
VisualStudio 27

Archive · View All
December 2010 16
July 2011 13
April 2011 13
April 2012 12
January 2011 12
June 2011 11
May 2011 11
May 2012 8
February 2013 7
January 2013 7

Creating an HttpHandler to handle request of your own extension

Jan 2 2011 8:02PM by Jalpesh   

I have already posted about http handler in details before some time here. Now let’s create an http handler which will handle my custom extension. For that we need to create a http handlers class which will implement Ihttphandler. As we are implementing IHttpHandler we need to implement one method called process request and another one is isReusable property. The process request function will handle all the request of my custom extension.

so Here is the code for my http handler class.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace Experiement
{
    public class MyExtensionHandler:IHttpHandler
    {
        public MyExtensionHandler()
        { 
            //Implement intialization here
        }
        
        bool IHttpHandler.IsReusable
        {
            get { return true; }
        }

        void IHttpHandler.ProcessRequest(HttpContext context)
        {
           string excuttablepath = context.Request.AppRelativeCurrentExecutionFilePath;

           if (excuttablepath.Contains("HelloWorld.dotnetjalps"))
           {
               Page page = new HelloWorld();
               page.AppRelativeVirtualPath = context.Request.AppRelativeCurrentExecutionFilePath;
               page.ProcessRequest(context);

           }
        }
    }
}

Here in above code you can see that in process request function I am getting current executable path and then I am processing that page.

Now Lets create a page with extension .dotnetjalps and then we will process this page with above created http handler. so let’s create it.

Creating your own extension

It will create a page like following.

Extension

Now let’s write some thing in page load Event like following.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Experiement
{
    public partial class HelloWorld : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write("Hello World");
        }
    }
}

Now we have to tell our web server that we want to process request from this .dotnetjalps extension through our custom http handler for that we need to add a tag in httphandler sections of web.config like following.

<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
      <httpHandlers>
        <add verb="*" path="*.dotnetjalps" type="Experiement.MyExtensionHandler,Experiement"/>
      </httpHandlers>
    </system.web>
</configuration>

That’s it now run that page into browser and it will execute like following in browser

Browser

That’s you.. Isn’t it cool.. Stay tuned for more.. Happy programming..

Shout it

Tags: C#.NET, BRH, #DOTNET, #ASP.NET, ASP.NET, HttpHandler,


Jalpesh
15 · 11% · 3478
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]