Scriptmanager.Registerstartupscript runs on the fly? or just after the sub end

Asked

Viewed 137 times

0

When executing this line:

ScriptManager.RegisterStartupScript(Page, Me.GetType, "OK", "openModal()", True);

the script is executed at the moment the debug pointer passes through it, or only after the sub processing is finished?

if this is the case only after processing, there is something that runs on time ?

  • There is no way something that is being processed on the server is immediately sent to the client, only after all the processing carried out on the server that the result is sent to the client. To better understand, why you want the debug to be executed on time?

  • Thanks for the answer, man is the following, I need to run a script that returns a value ai need to pass this value pro codebehind, I attached the function js that takes this value in the event click (javascript) of a button to finish, however this boot to finish tbm has an Asp.net event, that enters the problem seems that Asp runs before javascript, this js function plays this value in a hiden, my problem and fill this Hidden before Asp runs, because this Asp needs this data.

  • By your description you are using webforms and this button performs the postback. Have you tried using onsubmit instead of clicking the button? Form onsubmit you can perform something before performing the post.

  • Actually I didn’t know... I’ll take a look here and see if it helps... but this onsubmit you say Voce says is an event ? javascript/ or Asp?

  • 1

    It’s a javascript form event.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.