1
我已在XAML中以下內容:將一個aspx頁面轉到鏈接?
<Setter Property="Source" Value="ResourceHttpHandler.aspx" />
我想什麼在HTTP處理程序做的就是發回一個鏈接到一個標誌(如url.com/abc.png)和替換ResourceHttpHandler。 aspx與該徽標的鏈接。
這是我目前的嘗試:
public void ProcessRequest(HttpContext _HttpContext)
{
try
{
HttpRequest request = _HttpContext.Request;
HttpResponse response = _HttpContext.Response;
response.ContentType = MimeTypes.TextHTML;
response.Cache.SetExpires(DateTime.Now);
response.AppendHeader("Content-Disposition", MimeDispositions.Inline);
if(request.HttpMethod == WebRequestMethods.Http.Get)
{
response.Write("http://www.google.com/intl/en_com/images/srpr/logo3w.png");
response.Flush();
}
}
catch(Exception e)
{
_HttpContext.Response.Clear();
_HttpContext.Response.Write(HttpResponseString.CreateError(e.Message));
_HttpContext.Response.Flush();
}
}
我該怎麼辦呢?