Question

I am using update panel and update progress control. In update panel I have textbox with TextChange event. This event is automatically called from javascript when user enters 10 digits into textbox. The call is :

__doPostBack("LabelTextBoxCode", "TextChanged");

This is my html code :

    <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdateProgress runat="server" ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel">
            <ProgressTemplate>
                ...processing
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
 <asp:TextBox ID="LabelTextBoxCode" runat="server" OnTextChanged="TextChanged_TextBoxCode">
                        </asp:TextBox>
    ...
  </ContentTemplate>
    </asp:UpdatePanel>

So far what I found is this thread UpdateProgress Not working when called thru javascript but it does not help me (I do not know how to use it right in my case).

When I press any button in update panel, progress bar is showing, problem is just with this manually called __doPostBack from javascript.

How to fix it and make updateProgress works ?

Was it helpful?

Solution

Directly calling __doPostback bypasses all the triggers that set the update panel in action. So to avoid that you can either call the OnBeginRequest handler or you can trigger the same button click instead of calling the __dopostback. To trigger button click you can make use of jquery trigger function. You can get an example here.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top