0

I'm trying to execute a virtual path inside a HTTP module (I want to capture the result).

But I get an error:

Error executing child request for /home/something/.

Code:

public void ExecuteUrl(string url)
{
    var sb = new StringBuilder();
    var sw = new StringWriter(sb);
    HttpContext.Current.Server.Execute(url, sw);
    return sb.ToString();
}

Another related question says that it's by design, and the accepted answer won't work for me since I want to capture the result.

Is there another approach that I can take?

Community
  • 1
  • 1
jgauffin
  • 99,844
  • 45
  • 235
  • 372

0 Answers0