1

I am trying to run a routine that (when a button is clicked) changes an asp:label's text to "Please Wait..." using Javascript, and then goes away and runs a c# function that changes the asp:label's text to "Finished" when it is complete.

I can get the Javascript to work:

<asp:Button ID="Button1" runat="server" Text="Upload"
                    onclientclick="document.getElementById('errorMessage').innerText='Please Wait...';" />

And I can run the c# bit fine too:

<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />

But I can't figure out how to make them run together. (i.e. Javascript first, and then c#.

Cheers for any advice,

Ben

1 Answer 1

2

OK - that was obvious:

<asp:Button ID="Button1" runat="server" Text="Upload"
                    onclientclick="document.getElementById('errorMessage').innerText='Please Wait...';" 
                    onclick="Button1_Click"  />

Thanks anyway!

Ben

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.