Mono Support how to refresh only poll web part instead of whole page on voting ? (Closed)

Viewed 14624 time(s), 3 post(s), 2/5/2013 5:32:25 AM - by super
2/5/2013 5:32:25 AM
6018 Reputation 709 Total posts

right now I have poll on my website but users on my website complained that my site poll is not user friendly..if anyone votes on poll, it refreshes the whole page n takes then to top of the page ...it should only refresh the poll web part n not the whole page...

feature request : please solve this issue in monox n make it more user friendly....

1
2/5/2013 7:58:55 AM
15993 Reputation 2214 Total posts

Hi,

thanks for the feedback we have updated the Poll WebPart and added UpdatePanel so it's dynamically updated now. In order to fix this in your build you will have to update the following  mark-up file or wait for the next nightly build and upgrade.

To fix the issue update the "~\Portal\MonoX\ModuleGallery\PollModule.ascx" with the following:

<%@ Control
    Language="C#"
    AutoEventWireup="true"
    Inherits="MonoSoftware.MonoX.ModuleGallery.MonoXPollModule"
    CodeBehind="PollModule.ascx.cs" %>
 
<asp:Panel runat="server" ID="pnlContainer">
    <div class="poll">
        <asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
            <ContentTemplate>
                <h2><asp:Label runat="server" ID="lblQuestion"></asp:Label></h2>
                <asp:Panel runat="server" ID="pnlInput" Width="100%">
                    <asp:RadioButtonList runat="server" ID="rblAnswers" CellPadding="5">
                    </asp:RadioButtonList>
                    <div class="button-holder">
                        <asp:LinkButton runat="server" ID="btnVote" OnClick="btnVote_Click" CssClass="styled-button" />
                        <asp:LinkButton runat="server" ID="btnResults" OnClick="btnResults_Click" CssClass="styled-button" />
                    </div>
                </asp:Panel>
                <asp:Panel runat="server" ID="pnlGraph" Width="100%">
                    <asp:Repeater runat="server" ID="rptGraph">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblAnswer" CssClass="answer" Text='<%# GetAnswerText(Eval("Answer").ToString(), int.Parse(Eval("Votes").ToString())) %>'></asp:Label>
                            <div class="poll-holder">
                                <asp:Panel runat="server" ID="pnlWidth" BackColor='<%# GetColor(Eval("Color").ToString()) %>' Width='<%# GetWidth(Eval("Votes").ToString()) %>' CssClass='<%# GetColor(Eval("Color").ToString()).Equals(System.Drawing.Color.Empty) ? "poll-bg-color" : String.Empty  %>'></asp:Panel>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                    <div class="button-holder">
                        <asp:LinkButton runat="server" ID="btnShowVotePanel" OnClick="btnShowVotePanel_Click" CssClass="styled-button" />
                        <strong class="total-votes"><asp:Label runat="server" ID="lblTotal"></asp:Label></strong>
                    </div>
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Panel>
Regards

2
2/5/2013 2:35:37 PM
6018 Reputation 709 Total posts

thanks khorvat, problem solved - You are the best !!!

3
This is a demo site for MonoX. Please visit Mono Software for more info.