Hello,
I am attempting to integrate Rad Controls for AJAX with an MVC View-Page. An issue I had early on has reared its head again during development. If I modify the mark-up for my page such that it is in an erroneous state, and then try and run the page, I would expect to see something akin to "Server Error - Error Message Here." Unfortunately, my error messages are becoming compressed and never decompressed. This leads to garbage characters being rendered on the screen instead of a helpful error message.
The first time I encountered this issue it was code in our solution --
After adding in the check for debugging I began seeing my helpful error messages again.
Now, I recently went into my web.config and added the lines necessary to enable RadCompression. My issue has arisen once again -- I see garbage characters instead of error messages.
Is there something I should be checking elsewhere in my code, the data type of the stream or something, to account for errors + RadCompression?
Kind regards,
Sean
I am attempting to integrate Rad Controls for AJAX with an MVC View-Page. An issue I had early on has reared its head again during development. If I modify the mark-up for my page such that it is in an erroneous state, and then try and run the page, I would expect to see something akin to "Server Error - Error Message Here." Unfortunately, my error messages are becoming compressed and never decompressed. This leads to garbage characters being rendered on the screen instead of a helpful error message.
The first time I encountered this issue it was code in our solution --
public
override
void
OnActionExecuting(ActionExecutingContext context)
{
//This compression filter eats server errors. I'd like to see them during debugging.
if
(!HttpContext.Current.IsDebuggingEnabled)
{
HttpRequestBase request = context.HttpContext.Request;
string
acceptEncoding = request.Headers[
"Accept-Encoding"
];
if
(
string
.IsNullOrEmpty(acceptEncoding))
return
;
acceptEncoding = acceptEncoding.ToUpperInvariant();
HttpResponseBase response = context.HttpContext.Response;
if
(acceptEncoding.Contains(
"GZIP"
))
{
response.AppendHeader(
"Content-encoding"
,
"gzip"
);
response.Filter =
new
GZipStream(response.Filter, CompressionMode.Compress);
}
else
if
(acceptEncoding.Contains(
"DEFLATE"
))
{
response.AppendHeader(
"Content-encoding"
,
"deflate"
);
response.Filter =
new
DeflateStream(response.Filter, CompressionMode.Compress);
}
}
}
After adding in the check for debugging I began seeing my helpful error messages again.
Now, I recently went into my web.config and added the lines necessary to enable RadCompression. My issue has arisen once again -- I see garbage characters instead of error messages.
Is there something I should be checking elsewhere in my code, the data type of the stream or something, to account for errors + RadCompression?
Kind regards,
Sean