SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

asp.net generic handler (.ashx) template

Last post 05-19-2008 4:03 PM by becoming a pilot. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-19-2008 4:03 PM

    asp.net generic handler (.ashx) template

    This is for C#. Works for me but I just started using SharpDevelop yesterday so it might be some stupid things done???

     So create a file called CSharp.Web.HttpHandler.xft inside data\templates\file\CSharp\ and copy this into it

     

     

    <?xml version="1.0"?>
    <Template author="http://flightschools.aircraftdata.net" version="1.0">

     <Config
      name        = "Generic HttpHandler"
      icon        = "C#.File.NewClass"
      category    = "C#"
      subcategory = "ASP.NET"
      defaultname = "GenericHandler${Number}.ashx"
      language    = "C#"
     />

     <Description>${res:Templates.File.HttpHandler.Description}</Description>
     <!--
     Special new file templates:
      ${StandardNamespace}        -> Standardnamespace of the current project or FileNameWithoutExtension
      ${FullName}                 -> Full generated path name
      ${FileName}                 -> File name with extension
      ${FileNameWithoutExtension} -> File name without extension
      ${Extension}                -> Extension in the form ".cs"
      ${Path}                     -> Full path of the file
      -->
     <Files>
      <File name="${Path}/${FileNameWithoutExtension}.cs" DependentUpon="${FileName}" language="C#"><![CDATA[${StandardHeader.C#}

    using System;
    using System.Data;
    using System.Web;
    using System.Collections;
    using System.Web.Services;
    using System.Web.Services.Protocols;

    namespace ${StandardNamespace}
    {
        /// <summary>
        /// Summary description for $codebehindclassname$
        /// </summary>
        [WebService(Namespace = "http://tempuri.org/")]
        [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
        public class ${ClassName} : IHttpHandler
        {
            public void ProcessRequest(HttpContext context)
            {
      }

            public bool IsReusable
            {
                get
                {
                    return false;
                }
            }
      
      
     }
    }

    ]]></File>
      <File name="${FullName}"><![CDATA[
    <%@ WebHandler  Class="${StandardNamespace}.${ClassName}" Language="C#" CodeBehind="${FileNameWithoutExtension}.ashx.cs" %>

    ]]>  </File>

     </Files>

     <AdditionalOptions/>
    </Template>

     

Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.