用户控制事件处理 [英] User Control Event Handling

查看:64
本文介绍了用户控制事件处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在使用一个用户控件,因为我添加了一个网格视图来显示,编辑,更新和删除记录。我已经在我的代码中动态地调用该用户控件并将req值传递给它。我有一个树视图,它将显示该用户控件中的网格。但现在的问题是,当我要点击编辑或删除网格视图的链接时,用户控件会消失[导致网格视图消失]。那么我该怎么做才能解决这个问题。如何调用编辑,删除,更新网格视图的方法。

Hello,

I am using one user control in that i have added a grid view to display,edit,update and delete the records. I have call that user control dynamically in my code and passed req value to it. I have a tree view base on that it will show me the grid in that user control. But now the problem is when i am going to click on edit or delete link of grid view the user control disappear[which causes grid view to be disappear]. So what can i do to handle this issue. how i can get call to edit,delete,update methods of grid view.

推荐答案

必须在页面的每个帖子上重新创建动态控件,不仅仅是第一次创建!

当你点击网格上的一个按钮时,点击会启动回发到服务器,但在那个流程中你不会创建动态控件,所以它从页面中消失...

如果你学习使用AJAX,你可以节省大量的工作和网络使用...
A dynamic control must be re-created on each and every post to the page, not only on the first creation!
When you hit one of your buttons on the grid, the click initiates a post-back to the server, but in that flow you do not create your dynamic control so it disappears from the page...
You can save yourself a lot of work and network usage if you learn using AJAX...


这篇关于用户控制事件处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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