Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • HTTP Handlers

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 173
    Comment on it

    HTTP Handlers are mainly used to handle the requests caused by the user or by an error and we will handle it by navigating to some other location or with some other message.


    For defining HTTP Handlers first the entry will be made in Web.Config file


    <httpHandlers>
        <add verb="*" path="*.cspx" type="CspxHandler"/>
    </httpHandlers>
    


    This means any kind of .cspx type call will be handled by the handler we defined in our Web.Config file.


     public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
    
            if (context.Request.RawUrl.Contains(".cspx"))
            {
                string newUrl = context.Request.RawUrl.Replace(".cspx", ".aspx");
                context.Server.Transfer(newUrl);
            }
        }
    
    .net

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: