回发后动态控件迷失 [英] Dynamic controls getting lost after post back
本文介绍了回发后动态控件迷失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好吧
我在占位符和转发器的帮助下创建了动态控件,但回传后控件丢失了......请有人帮帮我解决这个问题。
谢谢
Hi All
I have created dynamic controls with help of place holder and repeater but the controls are getting lost after postback...please can someone help me to resolve this.
Thanks
推荐答案
你好b $ b
在回发后你将无法获得动态生成控件的值。
您可以使用客户端脚本(javascript)在隐藏字段中存储动态控件的值..
,你可以从后面的代码隐藏字段中访问这些值。
Hi
You wont be able to get the value of dynamic generated controls after postback.
You can store the values of the dynamic controls in Hidden field using Client Side scripting ( javascript )..
and you can access those values from hidden field in code behind.
好的你可以做一件事
ok you can do one thing on
if (!IsPostBack)
{
string tripid = "11850"; //Request.QueryString["tripid"].ToString();
getStage();
QuestionsPopulate("Booking");
}
你已经在调用getStage();
现在把其他那里
和
将以下代码放入
You are already calling getStage();
now put else there
and
put following code in that
drpStage.DataBind();
如何在ASP.NET中动态创建控件并从中检索值 [ ^ ]
以上链接肯定会对你有帮助...
How to create controls dynamically in ASP.NET and retrieve values from it[^]
above link will definitely help to you...
这篇关于回发后动态控件迷失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文