Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

XForm Statistics - Polls - EPiServer 7 MVC


Has anyone been able to get XForm Statistics - Polls to work in EPiServer 7 using MVC ? If so please can you guide me in the right direction



Sep 13, 2013 11:39


did you maybe found the solution for this ?

I am trying to do custom rendering in MVC. I can get statistics via GetPostedDataStatistics(....) but I dont know how to get the select options. I can get them if somebody already voted by GetPostedData() for every voted select option but I don't think that this is the way. Should I parse Form.Document xml to get all available options?



Nov 26, 2014 15:59

I have succeded on this way:

var htmlFragments = form.CreateHtmlFragments();
                        var choices = new List<PollAnswerViewModel>();
                        foreach (var item in htmlFragments)
                            if (item is EPiServer.XForms.Parsing.Select1AsRadiobuttonFragment)
                                var fragment = item as EPiServer.XForms.Parsing.Select1AsRadiobuttonFragment;
                                var options = fragment.Options;
                                foreach (var select in options)
                                    var pollAnswerItem = new PollAnswerViewModel
                                        Answer = @select.Text,
                                        Value = @select.Value
                                viewModel.PollAnswers = choices;

If somebody maybe has the better way, please say it :)


Nov 27, 2014 15:40
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.