c# - Button properties not changing on click event -
it's simple, however, button text , enabled state don't change when page valid.
i have button on web form , following code behind on save click event:
if (page.isvalid) { btnsave.enabled = false; btnsave.text = "saving, please wait..."; // save method, etc... }
you first setting button enabled state , text, , running saving methods.
this happens server-side, within request caused button click. client browser not receive completed response until after save method has run.
if want button change before save method run, must client-side javascript.
Comments
Post a Comment