1
如何解決這個錯誤IISHandler誤差不實現接口成員 'System.Web.IHttpHandler.IsReusable',
Error 3 'FMMadminModule.IISHandler1' does not implement interface member 'System.Web.IHttpHandler.IsReusable',
Error 4 'FMMadminModule.IISHandler1' does not implement interface member 'System.Web.IHttpHandler.ProcessRequest(System.Web.HttpContext)'
這裏是我的處理程序
`using System;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Web.SessionState;
namespace FMMadminModule
{
public class IISHandler1 : IHttpHandler
{
/// <summary>
/// You will need to configure this handler in the web.config file of your
/// web and register it with IIS before being able to use it. For more information
/// see the following link: http://go.microsoft.com/?linkid=8101007
DataTable dt;
int key;
byte[] imageOut;
public void ProcessRequest(HttpContext context)
{
HttpResponse response = context.Response;
HttpRequest request = context.Request;
context.Response.ContentType = "image/jpeg";
response.BufferOutput = false;
// get the key, the index into the DataTable
key = Convert.ToInt32(request.QueryString["Ind"]);
// Prepare the datatable to hold the SNo key and the jpeg image, which will be written out
dt = new DataTable();
dt = (DataTable)context.Session["dt"];
if (!dt.Rows[key]["Evidence"].Equals(null))
{
imageOut = (byte[])dt.Rows[key]["Evidence"];
response.OutputStream.Write(imageOut, 0, imageOut.Length);
}
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
}
好的,謝謝你。任何想法reg這個數據綁定方法,如Eval(),XPath()和Bind()只能用於數據綁定控件的上下文中。 – Sun
@孫,最好再問一個問題。 – Marko