Beispiel #1
0
        private void GetWebpartZoneByPageId(HttpRequest request, HttpResponse response)
        {
            int pageId = ValidationHelper.GetInteger(request.QueryString["id"], 0);
            using (PageProvider pageProvider = new PageProvider())
            {
                using (LayoutWebPartZoneProvider layoutWebPartZoneProvider = new LayoutWebPartZoneProvider())
                {
                    PageInfo pageInfo = pageProvider.Select(pageId, new ErrorInfoList());
                    if (pageInfo != null)
                    {
                        List<LayoutWebPartZoneInfo> webPartZones =
                            layoutWebPartZoneProvider.SelectAllByLayoutId(pageInfo.PageLayoutId, new ErrorInfoList());
                        DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(List<LayoutWebPartZoneInfo>));

                        serializer.WriteObject(response.OutputStream, webPartZones);
                        response.OutputStream.Close();
                    }
                }
            }
        }