In case we are registering a java script inside the Server side code using RegisterStartupScript. would the script be added to the page each time the RegisterStartupScript is invoked?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, So if you call
RegisterStartupScript()from a button click postback event, it will be included in the page for that post back but it will not be included for other postbacks. If you callRegisterStartupScript()inPage_Loadif will be included everytime (which might be pointless as you can just statically include the script to the page).