csharp HttpHandler示例代码

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp HttpHandler示例代码相关的知识,希望对你有一定的参考价值。

<%@ WebHandler Language="C#" Class="Handler" %>
using System;
using System.Web;
public class Handler : IHttpHandler {
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "html";
        context.Response.Write("Hello World");
        manaeform(context);
    }
    public void manaeform(HttpContext context)
    {
        context.Response.Write("<html><body><form>");
        context.Response.Write("<h2>Select your feature</h2>");
        if (context .Request .Params ["Feature"]==null)
        {
            context.Response.Write("<select name='Feature'>");
            context.Response.Write("<option>asp.net </option>");
            context.Response.Write("<option>java </option>");
            context.Response.Write("</select></form></body></html>");
        }
    }
    public bool IsReusable {
        get {
            return false;
        }
    }
}

以上是关于csharp HttpHandler示例代码的主要内容,如果未能解决你的问题,请参考以下文章

选择HttpHandler还是HttpModule?

csharp power BI博客的示例代码

csharp 演示如何自定义ItemInfo架构元素内容的示例代码

从 httpHandler 读取的 Ext.net 动态 gridPanel

csharp 内容生成器的示例代码,用于将子文本元素添加到当前元素

HttpHandler实现网页图片防盗链