在ASP.NET中动态创建控件的Loadpostdata [英] Loadpostdata of dynamically created controls in ASP.NET

查看:78
本文介绍了在ASP.NET中动态创建控件的Loadpostdata的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。任何人都可以解释,当webservercontrol的加载后期数据事件执行时,如果它是在pageload而不是init中创建的?[asp.net,C#]


2.我的要求是创建一个文本框动态地基于一些contition.so我在pageload中创建它。当页面被回发(使用提交按钮)我能够在submitbtn_click事件中动态创建的文本框中访问用户输入的数据。

我不明白原因,为什么我能够在动态创建的文本框中访问用户输入的数据,当我在加载发布数据事件后发生的页面加载中创建它时。[asp.net,C#]

1. Can anyone explain ,when Load post data event of a webservercontrol executes ,if it is created in pageload instead of init?[asp.net,C#]

2.My requirement was to create a textbox dynamically based on some contitions.so i created it in pageload.when the page is posted back(using a submit button) i am able to access user entered data in my dynamically created text box in submitbtn_click event.
I didnot understand the reason ,why i am able to access user entered data in my dynamically created text box, when i am creating it in page load which occurs after Load post data event .[asp.net,C#]

推荐答案

hi knknknkn,


欢迎来到剧本。您可以在各个专家讨论的论坛中找到更好的回答问题,例如这些问题(您可以在屏幕的右侧找到)。我现在正在将这篇文章移到.NET论坛....
hi knknknkn,

Welcome to theScripts. You will find better responses to questionsd such as these in the various forums where the experts hang out (which you''ll find on the Right Hand Side of the screen). I am moving this post to the .NET forum for you now....



hi knknknkn,

欢迎来到剧本。您可以在各个专家讨论的论坛中找到更好的回答问题,例如这些问题(您可以在屏幕的右侧找到)。我现在将这篇文章移到.NET论坛....
hi knknknkn,

Welcome to theScripts. You will find better responses to questionsd such as these in the various forums where the experts hang out (which you''ll find on the Right Hand Side of the screen). I am moving this post to the .NET forum for you now....



ok谢谢DeMan


ok thanks DeMan


执行代码逐行,所以只要在任何事件执行之前在代码中创建文本框,并且用户有机会填写然后它就可以工作。当执行click事件并且在调用时存在文本框时没有问题。如果您仍然对更精细的细节感兴趣,本文可能会有所帮助:
ASP.NET页面生命周期概述
Code is executed line by line, so as long the textbox is created in the code before any event is executed and the users have an opportunity to fill in then it works. As the click event is executed and the textboxes exist when called there is no problem. If you are still interested in the finer details, this article may help:
ASP.NET Page Life Cycle Overview


这篇关于在ASP.NET中动态创建控件的Loadpostdata的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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