AJAX UpdatePanel动态控件和RegisterStartUpScript单击两次 [英] AJAX UpdatePanel dynamic controls and RegisterStartUpScript click twice

查看:47
本文介绍了AJAX UpdatePanel动态控件和RegisterStartUpScript单击两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我已经阅读了数百篇有关此问题的帖子,但没有一个能解答我的情况。所以希望有人可以提供帮助!


我在updatepanel(AJAX控件工具包)中有一个gridview,因为我不支持分页/排序我添加了自己的自定义分页。我已在updatepanel中动态加载LinkBut​​tons以更改页面,但它们仅在第二次单击时触发。我还在行中附加了javascript,以便在您单击时可以选择它们。再次只有第二次点击工作。


我在事件处理程序中有DataBind,而第一次加载页面时我只有DataBind。当我调试点击事件时,只会第二次触发?


任何想法?


提前致谢

Hi,

I have read hundreds of post regarding this issue, but none have an answer for my situation. So hopefully somebody here can help!

I have a gridview in an updatepanel (AJAX control toolkit) and because paging/sorting aren''t supported I''ve added my own custom paging. I have dynamically loaded LinkButtons in the updatepanel to change the page but they only fire on the second click. I have also attached javascript to the rows so that they can be selected when you click. Again only the second click works.

I have DataBind in the event handlers and I only DataBind the first time when the page is loaded. When I debug the click events only fire the second time??

Any ideas?

Thanks in advance

推荐答案





我已经阅读了数百篇有关此问题的帖子,但没有一个能解答我的情况。所以希望有人可以提供帮助!


我在updatepanel(AJAX控件工具包)中有一个gridview,因为我不支持分页/排序我添加了自己的自定义分页。我已在updatepanel中动态加载LinkBut​​tons以更改页面,但它们仅在第二次单击时触发。我还在行中附加了javascript,以便在您单击时可以选择它们。再次只有第二次点击工作。


我在事件处理程序中有DataBind,而第一次加载页面时我只有DataBind。当我调试点击事件时,只会第二次触发?


有什么想法吗?


提前付款
Hi,

I have read hundreds of post regarding this issue, but none have an answer for my situation. So hopefully somebody here can help!

I have a gridview in an updatepanel (AJAX control toolkit) and because paging/sorting aren''t supported I''ve added my own custom paging. I have dynamically loaded LinkButtons in the updatepanel to change the page but they only fire on the second click. I have also attached javascript to the rows so that they can be selected when you click. Again only the second click works.

I have DataBind in the event handlers and I only DataBind the first time when the page is loaded. When I debug the click events only fire the second time??

Any ideas?

Thanks in advance



我会的建议将GridView从UpdatePanel中取出。

有没有理由说它必须在那里?



您是否尝试过移动分页GridView外部的LinkBut​​tons(将它们置于上方或下方或其他位置)。

I''d suggest taking the GridView out of the UpdatePanel.
Is there any reason why it has to be there?


Have you attempted moving the paging LinkButtons outside of the GridView (place them above or below or something).


Hi Frinavale,


感谢您的回复!


我希望updatepanel中的gridview创建一个似乎所见即所得的CMS。


一旦我完成了演示,我计划开源项目并邀请其他开发人员帮助改进它,就像更新的AJAX WYSIWYG版DOTNETNUKE一样。


无论如何,LinkBut​​tons在gridview之外,它们是在gridview下面的占位符中动态创建的。但是javascript显然附加在gridview的每一行。因此,对我而言,这一定是一个简单的错误,因为这些都不会在第一次点击时重新执行。 updatepanel处于条件模式,ChildTriggers设置为true。我已经读过我应该为每个动态控件创建动态触发器,但这并不能解释为什么javascript行也不起作用。


我''我真的难倒这个!
Hi Frinavale,

Thanks for responding!

I want the gridview in the updatepanel to create a seemles WYSIWYG CMS.

Once I''ve finished the demo I plan to open source the project and invite other developers to help improve it like a updated AJAX WYSIWYG version of DOTNETNUKE.

Anyway, the LinkButtons are outside the gridview they are dynamically created in placeholder below the gridview. But the javascript is obviously attached to each row of the gridview. So it must be a simple error on my part because both of these don''t re-act on the first click. The updatepanel is in conditional mode with ChildTriggers set to true. I''ve read that I should create dynamic triggers for each of the dynamic controls but that doesn''t explain why the javascript rows aren''t working either.

I''m really stumped on this one!



Hi Frinavale,


感谢您的回复!


我希望updatepanel中的gridview创建一个似乎所见即所得的CMS。


一旦我完成了演示,我计划开源该项目并邀请其他开发人员帮助改进它,就像更新的AJAX WYSIWYG版本的DOTNETNUKE一样。


无论如何,LinkBut​​tons在gridview之外,它们是在gridview下面的占位符中动态创建的。但是javascript显然附加在gridview的每一行。因此,对我而言,这一定是一个简单的错误,因为这些都不会在第一次点击时重新执行。 updatepanel处于条件模式,ChildTriggers设置为true。我已经读过我应该为每个动态控件创建动态触发器,但这并不能解释为什么javascript行也不起作用。


我''我真的难倒这个!
Hi Frinavale,

Thanks for responding!

I want the gridview in the updatepanel to create a seemles WYSIWYG CMS.

Once I''ve finished the demo I plan to open source the project and invite other developers to help improve it like a updated AJAX WYSIWYG version of DOTNETNUKE.

Anyway, the LinkButtons are outside the gridview they are dynamically created in placeholder below the gridview. But the javascript is obviously attached to each row of the gridview. So it must be a simple error on my part because both of these don''t re-act on the first click. The updatepanel is in conditional mode with ChildTriggers set to true. I''ve read that I should create dynamic triggers for each of the dynamic controls but that doesn''t explain why the javascript rows aren''t working either.

I''m really stumped on this one!



我记得前一段时间遇到同样的问题(不得不点击两次)......但我不记得我是怎么绕过它的。


让我看看我是否不能帮你在网上找到关于这个问题的东西。


-Frinny

I remember a while ago having the same problem (having to click twice)...but I can''t remember how I got around it.

Let me see if I can''t help you find something online regarding the issue.

-Frinny


这篇关于AJAX UpdatePanel动态控件和RegisterStartUpScript单击两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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