回发后动态控件迷失

编程入门 行业动态 更新时间:2024-10-27 16:31:42
本文介绍了回发后动态控件迷失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好吧 我在占位符和转发器的帮助下创建了动态控件,但回传后控件丢失了......请有人帮帮我解决这个问题。 谢谢

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...

更多推荐

回发后动态控件迷失

本文发布于:2023-10-12 20:44:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485849.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   动态   回发后

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!