More in this section
Forums / Bugs & Issues / Return Code 0, Json, Custom Designer

Return Code 0, Json, Custom Designer

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. L
    L avatar
    1 posts
    Registered:
    11 Sep 2013
    25 Oct 2013
    Link to this post
    Hi guys,
    I just create a Designer for my Custom Widget and went i try to Edit the content my Widget show this Error : Return Code 0

    And i have this in my Log :

    Type : System.Web.HttpException, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    Message : Server cannot set status after HTTP headers have been sent.


    My issues is because i use this code in my Controller for trimming my Json result. Because i d'ont want he return me a partial View();
    My Code :

            protected override void OnActionExecuting(ActionExecutingContext filterContext)
            {
                if (Request.IsAjaxRequest())
                    Response.Clear();

                base.OnActionExecuting(filterContext);
            }

            protected override void OnResultExecuted(ResultExecutedContext filterContext)
            {
                if (Request.IsAjaxRequest())
                    Response.End();

                base.OnResultExecuted(filterContext);
            }


    So if you have the same problem d'ont use : if (Request.IsAjaxRequest()).

    Use a Boolean for just executing the action on the good request because now the code was executed on every Ajax Request.

    I Hope this help.
  2. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    30 Oct 2013
    Link to this post
    Hello,

    Thank you for sharing your solution with the community. As a token of appreciation I have increased your Telerik points accordingly. 

    Regards,
    Pavel Benov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered