.NET C # - calling a javascript method after validating a page?

I have a simple javascript (JQuery based) method that does some css magic to show / hide some divs when a user submits a .net webform

function doShowHide()
{
  $('.Button').hide();
  $('.ButtonHdn').show();
}

      

I am using the inline .net validation checkout so I need the WebForm_DoPostBackWithOptions () method to run in addition to the js snippet above. Consistency, however, is what I'm having trouble with. I need the validation to take place (and be valid) before my js code has exceeded the number of lights (I don't want to hide the button if the page is invalid).

Any suggestions would be much appreciated.

My end goal is for the submit button to disappear (on successful checkout) and be replaced with another button that is disabled and says "Wait ...". I have a problem with google, but everyone seems to have a problem, but no one has a simple answer. The community here always has the best answers, so I thought I'd post my problem here.

Thank!

+2


source to share


1 answer


If you want to execute a javascript function after executing server side code, you can use

Page.ClientScript.RegisterStartupScript()

      



See article msdn .

+1


source







All Articles