السلام عليكم ورحمة الله وبركاته
انا اول مرة اشترك فى الموقع
فعلا موقع روعة وجميل الله يعينكم على تنميته وتطويره ونجاحه
بس كانت موجهانى مشكلة اثناء كتابة كود داخل بروجكت فى الويب ابلكاشن
انا لسه مبتدئة
وهى انى انشأت radio button list من نوع اراى وجوه فور لوب انشأت الradio button list فى runtime وعطيتها ل panel
المشكلة انى فى button عايزة اعرف اللى ال user اختاره من كل radio button list
والكود كما يلى
{
int cat=int.Parse(Request.QueryString["categ"]);
int num=int.Parse(Request.QueryString["num"]);
string[] ar=new string[num,3];
Label[] lb=new Label [num];
for(int t=0; t<=num-1; t++)
{
start1:
Random rd=new Random();
rd.Next(8);
int q=rd.Next(8);
cm=new SqlCommand();
cm.CommandText="select * from question where questionid="+q+" and catid="+cat;
cm.Connection=sqlConnection1;
sqlDataAdapter1.SelectCommand=cm;
sqlDataAdapter1.Fill(dataSet22,"question");
int i=dataSet22.Tables["question"].Rows.Count;
if(i==0)
goto start1;
else
{
ar[t,0]=dataSet22.Tables["question"].Rows[0][0].ToString();
ar[t,1]=dataSet22.Tables["question"].Rows[0][1].ToString();
ar[t,2]=dataSet22.Tables["question"].Rows[0][2].ToString();
}
lb[t]=new Label();
lb[t].Text=dataSet22.Tables["question"].Rows[0][1].ToString();
Panel1.Controls.Add(lb[t]);
cm.CommandText="select * from choices where questionid="+q;
cm.Connection=sqlConnection1;
sqlDataAdapter1.SelectCommand=cm;
sqlDataAdapter1.Fill(dataSet22,"choice");
int y=dataSet22.Tables["choice"].Rows.Count;
RadioButtonList[] rbl=new RadioButtonList[num];
rbl[t]=new RadioButtonList();
for(int s=0; s<=y-1; s++)
{
rbl[t].Items.Add(dataSet22.Tables["choice"].Rows
}
Session["arr"]=ar;
Panel1.Controls.Add(rbl[t]);
}
if(!IsPostBack)