There is a method for esclude
aspx page from pipeline in the use nancy.Owin
in a old webform site project not compiled?
When I configure nancy the post-back and the request is an aspx page the post-back is deleted because nancy delete it and recall the page.
public void NancyConfig(IAppBuilder app)
{
app.UseNancy(options =>
{
options.Bootstrapper = new MyBootstrapper();
options.PerformPassThrough = (context => context.Response.StatusCode == HttpStatusCode.NotFound);
});
app.UseStageMarker(PipelineStage.MapHandler);
}
The options.PerformPassThrough
wipe the post-back content and call the page. For not post-back is ok but in post-back elaboration this present an infinite loop.
How to configure NancyFx
for not wipe post-back in passtrought option?
I'have modified the nancy official 1.4 sources to esclude from .aspx and other page from pipeline, returning the request postback whitouth delete it. You can try this modify here .
Here te code to apply at line 82:
//Check if the webform is not present inthe path ".aspx"
//if present move to next
if (owinRequestPath.ToLowerInvariant().Contains(".aspx")
|| owinRequestPath.ToLowerInvariant().Contains(".asmx")
|| owinRequestPath.ToLowerInvariant().Contains(".ascx")
|| owinRequestPath.ToLowerInvariant().Contains(".ashx")
|| owinRequestPath.ToLowerInvariant().Contains(".asmx")
|| owinRequestPath.ToLowerInvariant().Contains(".asax")
) return next.Invoke(environment);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With