ASP.NET Register Script After Partial Page Postback (UpdatePanel)

I have a simple form (textbox, submit button) which is wrapped in an update panel. So, when i click the button, the server-side click event is fired (SubmitButton_Click), stuff happens to the db, and the page is re-rendered (asynchronously). Here's my issue - i need to execute some JavaScript after all the "stuff happens to the db". In other words, i need to create some JavaScript whose data/parameters are based on server-side logic. I've tried this: Page.RegisterStartupScript and this ScriptManager.RegisterStartupScript Neither work (nothing happens). Now i now i can hook into the `.add_pageLoaded` function using the client-side AJAX libary (to execute client-side scripts once partial update is complete), but the problem is i need data from the server that is created on the button click event. Ie: Sys.Application.add_init(function () { Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (sender, args) { var panels = args.get_panelsUpdated(); for (var i = 0; i

以上就是ASP.NET Register Script After Partial Page Postback (UpdatePanel)的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准