Click here to Skip to main content
14,236,064 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
I have searched and tried all of the examples that I could find for getting my program to update a textbox which is inside an UpdatePanel. I cannot get this to work.

What I have tried:

Here is my code

<div class="w3-row-padding  w3-center w3-mobile">            
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:Button ID="cmdSubmit" runat="server" Text="Create Life Budget" CssClass="w3-button w3-black" Font-Bold="False" UseSubmitBehavior="False" />
    <br />
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:TextBox ID="txtProgress" runat="server" Text="300" BackColor="Transparent" BorderStyle="None" CssClass="w3-center" ReadOnly="True" Width="300px" AutoPostBack="True"></asp:TextBox>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="cmdSubmit" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</div>


Protected Sub cmdSubmit_Click(sender As Object, e As EventArgs) Handles cmdSubmit.Click
    Master.HideMsg()
    CreateLifeBudget()
End Sub

Protected Sub CreateLifeBudget()
    '< Other Code>
    txtProgress.Text = "Processing " & iProgress & " of " & iProgressMax
    UpdatePanel1.Update()

    txtProgress.Text = "Processing " &amp; iProgress &amp; " of " &amp;    iProgressMax
    UpdatePanel1.Update()
End Sub


I am getting nothing to appear on the page. As I pasted the code into this question, could it be that since the actual code is inside another subroutine? I event tried it with the sub being Public.
Posted
Updated 4 days ago
Comments
   
If you want to become a "real" web developer, then my advise is to get rid of UpdatePanel and use AJAX instead to do asynchronous updates.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100