0

alex9453 iT邦新手 3 級 ‧ 2018-01-08 10:16:16 檢舉
C#

1 個回答

2

iT邦研究生 3 級 ‧ 2018-01-07 22:50:11

``````foreach(ListItem item in RadioButtonList1.Items)
{
if (item.Selected)
{
//做判斷
}
}
``````

alex9453 iT邦新手 3 級 ‧ 2018-01-09 21:56:32 檢舉

{
int score=0;
if(1.Selected)
{
score=25;
response.write(label1.text);
}
}

`if(1.Selected)``item.Selected`

alex9453 iT邦新手 3 級 ‧ 2018-01-10 14:53:11 檢舉

alex9453 iT邦新手 3 級 ‧ 2018-01-10 17:40:07 檢舉

alex9453 iT邦新手 3 級 ‧ 2018-01-10 21:54:02 檢舉

`lable1.Text`把分數附值不就好了?

alex9453 iT邦新手 3 級 ‧ 2018-01-11 12:54:13 檢舉

`````` label1.text=score.ToString()
``````
alex9453 iT邦新手 3 級 ‧ 2018-01-12 12:11:15 檢舉

protected void Button1_Click(object sender, EventArgs e)
{
int score= 0;
if(item.Selected)

``````    {
score = 25;
Response.Write(Label1.Text = score.ToString());

}

}
``````

`````` if (item.Selected)
{
//你要在裡面判斷 選擇的答案是否是正確答案
}
``````

alex9453 iT邦新手 3 級 ‧ 2018-01-12 22:30:55 檢舉

if(IsAllow.Items[0].Selected)
statement1;
else if(IsAllow.Items[1].Selected)
statement1;
else if(IsAllow.Items[2].Selected)
statement1;

`````` int totleSum = 0;

{
}

//...每項都這樣做

//顯示總分數
Label1.Text = totleSum.ToString();
``````