Turn a aspx page to a link?

Refresh

March 2019

Views

0 time

1

I have the following in XAML:

<Setter Property="Source" Value="ResourceHttpHandler.aspx" />

What I'd like to do in the HTTP handler is send back a link to a logo (such as url.com/abc.png) and replace ResourceHttpHandler.aspx with the link to that logo.

This is my current attempt:

  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( );
     }
  }

How do I do that?

1 answers

2

Perhaps simply redirecting would solve your problem.

Response.Redirect("http://www.google.com/intl/en_com/images/srpr/logo3w.png");