回传中占位符的控件为空!! - 紧急 [英] Controls in placeholder are null on postback !! - urgent

查看:80
本文介绍了回传中占位符的控件为空!! - 紧急的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在代码中使用了占位符,并在运行时动态添加了在行中具有单选按钮的asp表.

用户选择所需的单选按钮后,我需要在按钮单击事件上获取所选的单选按钮.但是代码使我抛出错误,指出空对象引用!

请帮助我解决此问题..如何检索单选按钮的选定值..

表填充必须动态完成,因为如果我没有使用所需的值,那么我正在使用Ajax导航到asp表中的下一组单选按钮.

预先感谢!

问候,
Divya

Hi,

I am using a placeholder in my code, And dynamically adding an asp table having radio buttons in the rows at run time.

Once user selects the required radio button I need to get the selected radio button on a button click event. But the code is throwing me an error stating null object reference !

Please help me in solving this problem.. How can i retrieve the selected value of radio button ..

Population of table has to done dynamically as I am using Ajax to navigate to next set of radio buttons in the asp table if required value does not appear at first.

Thanks in advance !

Regards,
Divya

推荐答案

如果在这种情况下动态添加控件,则需要自己保留控件的状态.有关更多详细信息,请查看以下文章.

在ASP.NET应用程序中为动态创建的控件保留状态 [
If you add control dynamically in that case you need to preserve the state of the control by yourself. For more details you can check following article.

Retaining State for Dynamically Created Controls in ASP.NET applications[^]

The other way around is to get the values of the control from Request.Form["ControlName"]


这篇关于回传中占位符的控件为空!! - 紧急的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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