日期:2014-05-19  浏览次数:20530 次

关于javascript的获得RadioButtonList的选择问题
RadioButtonList是。net控件
protected   System.Web.UI.WebControls.RadioButtonList   RadioButtonList1;
protected   System.Web.UI.HtmlControls.HtmlInputButton   hlnkOk;

if   (   !   IsClientScriptBlockRegistered(   "clientScript "   )   )  
{  
sb.Append(   " <script   language= 'javascript '> \n "   )  
.Append(   "   function   closedialog()   {   \n "   )  
.Append(   "   window.returnValue   =   document.getElementById( ' "   +   RadioButtonList1.ClientID     +   " ').value;\n "   )  
.Append(   "   window.close();\n "   )  
.Append(   "   }\n   "   )  
.Append(   " </script> \n "   );  
RegisterClientScriptBlock(   "clientScript ",   sb.ToString()   );  
}  
hlnkOk.Attributes.Add(   "onClick ",   "javascript:closedialog(); "   );
这是子页面的代码
父页面就是得不到RadioButtonList1.SelectedIndex的选择值

------解决方案--------------------
帮顶