Fixing “Operation is not valid due to the current state of the object” when using SSRS ReportViewer in ASP.Net MVC

So I’ve included the SSRS ReportView control within my ASP.Net MVC application. So far so good. Just displaying the report works fine after struggeling with the dimensions of the iframe and the ReportViewer control itself. But after a more complex drill-through report was display and then clicking the actions caused the famous error “Operation is […]

Redirect from the OnException-method inside the controller with ASP.Net MVC

If your controller uses the HandleError-Attribute it handles exceptions thrown by action methods. I wanted to catch these exceptions and redirect to a custom error page. A simple RedirectToAction inside the OnException method does not work. But the ExceptionContext is all we need. #region Error handling protected override void OnException(ExceptionContext filterContext) { // Make use […]

Problems with the ContentByQueryWebPart (CQWP) and its ItemXslLink-property

If you ever tried to set the ItemXslLink (which is a normal property of the ContentByQueryWebPart) you will see that sometimes this simply doesn’t work. You get an exception! Object reference not set to an instance of an objectObject reference not set to an instance of an object Why? The CmsDataFormWebpart.MakeSiteRelativeUrl (which is called somewhere […]