动态控制动态控制的回发事件在asp.net应用程序缺失 [英] Dynamic controls missing in asp.net application on postback event of dynamic control

查看:135
本文介绍了动态控制动态控制的回发事件在asp.net应用程序缺失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我添加按钮单击事件的动态控制,在我甲肝下拉控制,我养的一个事件,下拉选定指数的变化,我做了自动回发真实的,当我选择新项目从下拉我失去所有的动态控件

Hi I'm adding dynamic Controls on button click event,In that I hav dropdown control, I'm raising an event to drop down for selected index change, I made auto post back true, When I'm selecting new item from drop down I'm Losing all the dynamic controls

推荐答案

它继承每个服务器控件的 IPostBackDataHandler 接口有的LoadPostData 方法是处理回发数据时,由一个类实现控制(页,表格,占位符,控制等),类调用的LoadPostData 方法并传递发布的数据和关键以维持控制状态

Every server control which inherits IPostBackDataHandler interface have LoadPostData method that is for processing the postback data , when control implemented by a class (page, form, placeholders, controls etc), class calls the LoadPostData method and pass the posted data and key to maintain control states.

所有您需要回发在每一次前或页面加载事件中重新实例化/重新初始化动态控件和此控件添加到网页/表格/占位符,然后发布的数据将被自动分配通过由母公司控制和控制事件将触发调用的LoadPostData方法控制。

All you need to re-instantiate / reinitialize dynamic controls before or within page load event each and every time during postback and add this control to page / forms / placeholders then posted data will automatically be assign to the control by calling LoadPostData method by the parent control and control event will fire.

检查文章,以及如何编写code动态控制 -
如何保养动态控制的事件,在asp.net回发期间的数据

check the article and how to write code for dynamic control - How to maintain dynamic control events, data during postback in asp.net

这篇关于动态控制动态控制的回发事件在asp.net应用程序缺失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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