如何在部分页面回发的updatepanel内创建javascript amcharts [英] How to create javascript amcharts inside an updatepanel on partial page postback

查看:66
本文介绍了如何在部分页面回发的updatepanel内创建javascript amcharts的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个webform,我使用Amready方法创建了javascript Amcharts并使用div绑定到表单。我还有一个updatepanel,其中放置了为其创建Javascriprt amcharts的div。我在updatepanel点击内部还有一个按钮,它将执行部分页面回发。问题是当页面部分回发时,未执行javascript脚本,这不允许div绑定图表。图表变得不可见。我的问题是如何在部分页面回发之后使图表绑定。



我尝试了什么:



我创建了一个更新面板,并在更新面板中放置了图表div和一个按钮。在scriptmanager中,我添加了AMCharts的脚本引用。我尝试使用Sys.Application.Initialize()和Sys.Application.add_load(DrawAMchart)调用更新面板中的AMready函数;但没有任何工作。我还尝试使用ScriptManager.RegisterStartupScript()方法调用DrawAMChart()但在部分页面回发后无法获取图表。

I have a webform on which i created javascript Amcharts using Amready method and bind to the form using divs. i have also an updatepanel inside which divs are placed for which Javascriprt amcharts are created. I have also a button inside updatepanel clicking which will do the partial page postback. The problem is when the page is partially postback the javascript script is not executed which doesnot allow the divs to bind the chart. The charts become invisible. My question is how to make charts bind after the partial page postback.

What I have tried:

I created an update panel and placed the chart divs and a button inside the update panel. In the scriptmanager i added the script reference of AMCharts. I tried to call the function AMready inside update panel using Sys.Application.Initialize() and Sys.Application.add_load(DrawAMchart); but nothing is working. I also tried to call the DrawAMChart() using ScriptManager.RegisterStartupScript() method but could not able to get the chart after partial page postback.

推荐答案

不要使用如果可能的话更新面板。直接使用jquery.And调用webMethod
Don't use the update panel if possible.Go directly with the jquery.And call the webMethod


这篇关于如何在部分页面回发的updatepanel内创建javascript amcharts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆