We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Progressbar value not getting updated after first Postback

Thread ID:

Created:

Updated:

Platform:

Replies:

121902 Feb 5,2016 07:50 AM UTC Feb 8,2016 11:59 AM UTC ASP.NET Web Forms 1
loading
Tags: Progressbar
Gaurang
Asked On February 5, 2016 07:50 AM UTC

Hi,

I want to use progressbar in one of my forms to track the completeness of the profile, I need to place server side validations on each control and after validating the text, i want to update the Progressbar,

For trial, I used two buttons which on every click add or subtract 25 from the progressbar, 

After 1st postback the value gets changed but then after every subsequent postback the value remains same, I tried debugging and it is properly setting the value. Although while loading the complete page the value gets back to the previous one.

However this works fine with clientside scripting, I am just facing the issue on updating the value on the server side. Below is my code.

ASPX :-

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <script>
        function show(e) {
            var progresObj = $("#<%=ProgressBar1.ClientID%>").data("ejProgressBar");
            
            var x = parseInt(progresObj.getPercentage());
            if (e == 'add') {
                if (x < 100)
                    x += 25;
            }
            else {
                if (x > 0)
                    x -= 25;
            }
            
            progresObj.option("text", x + " %");
            progresObj.option("percentage", x);
        }
    </script>
    <div class="row">
        <asp:Button ID="btn1" runat="server" Text="+"  OnClick="btn1_Click" />
        <asp:Button ID="btn2" runat="server" Text="-"  OnClick="btn2_Click" />
        <input type="button" onclick="show('add')" value="Add" name="Add" />
        <input type="button" onclick="show('sub')" value="Sub" name="Add" />
    </div>
    <div class="row">
        <ej:ProgressBar ID="ProgressBar1" runat="server" Text="" Value="0">
        </ej:ProgressBar>
    </div>
    
</asp:Content>

CS :-

protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn1_Click(object sender, EventArgs e)
        {
            if (ProgressBar1.Value < 100)
            {
                ProgressBar1.Value += 25;
            }
        }

        protected void btn2_Click(object sender, EventArgs e)
        {
            if (ProgressBar1.Value > 0)
            {
                ProgressBar1.Value -= 25;
            }
        }

Please let me know if I have missed something or is there a solution to it. 

Thank You,
Gaurang Kelkar

Ezhil S [Syncfusion]
Replied On February 8, 2016 11:59 AM UTC

Hi Gaurang,

We were able to reproduce the reported issue with Progressbar value property, when set from post back and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Thanks,
Ezhil S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;