Execute javascript function after asp.net postback without Ajax

前端 未结 5 515
挽巷
挽巷 2020-12-16 11:08

I wish to execute a javascript function after asp.net postback with out using ajax.

I\'ve tried the following in my even method with no luck:

Page.Cl         


        
5条回答
  •  余生分开走
    2020-12-16 11:36

    I don't remember offhand what is the exact syntax/usage for the Page.ClientScript stuff ... that looks like it should work offhand. But if push comes to shove, just have a simple user control that you can enable/disable dynamically that will write out a javascript method in script blocks after the postback. When the page loads, this script execute whatever functionality you wish to execute.

    of course, the question is then, what is it that this javascript should do that you couldn't just do on the serverside via some property or other setting that would reflect in the markup?

提交回复
热议问题