private Int32[] VoteArray ={ 1,2,3,4};
protected void Page_Load(object sender, EventArgs e)
{
RadioButtonList objRadioButtonList = new RadioButtonList();
for (int i = 0; i < VoteArray.Length; i++)
{
objRadioButtonList.Items.Add(VoteArray[i].ToString());
//InAll = InAll + Convert.ToInt32(votenum[i]);
}
objRadioButtonList.ID = "radio1";
PlaceHolder1.Controls.Add(objRadioButtonList);
}
protected void btn_Vote_Click(object sender, EventArgs e)
{
RadioButtonList radio1 = (RadioButtonList)PlaceHolder1.FindControl("radio1");
for (int j = 0; j < VoteArray.Length; j++)
{
if (radio1.SelectedIndex == VoteArray[j])
{
//VotenumArray[j] = Convert.ToString(Convert.ToInt32(VotenumArray[j]) + 1);
//Response.Write("<script language='javascript'>alter(" + radio1.SelectedIndex + ");</script>");
Vote.Text = radio1.SelectedIndex.ToString();
}
}
}