我是beginner.radio按鈕,無法正常工作。我dn't知道什麼是一個問題單選按鈕在asp.net中不工作
protected void RadioButton1_CheckedChanged1(object sender, EventArgs e)
{
if (RadioButton1.Checked == true)
{
Label1.Text = "Upload our video file";
RadioButton2.Checked = false;
}
else
{
Label1.Text = "Upload our image file";
RadioButton1.Checked = false;
}
}
public void upload()
{
SqlCommand cmd = new SqlCommand("insert into video_info(Name,path,user_name,email,comment)values(@Name,@path,@user_name,@email,@comment)", con);
cmd.Parameters.AddWithValue("@Name", txt_file.Text);
cmd.Parameters.AddWithValue("@path", "video/" + fileuplod.FileName);
cmd.Parameters.AddWithValue("@user_name", use_name.Text);
cmd.Parameters.AddWithValue("@email", email.Text);
cmd.Parameters.AddWithValue("@comment", comment.Text);
fileuplod.SaveAs(Server.MapPath("~/video/" + fileuplod.FileName));
cmd.ExecuteNonQuery();
}
protected void submit_Click(object sender, EventArgs e)
{
upload();
}
}
我想要做,我有兩個無線電button.Image和video.Suppose用戶選擇image.then所有細節將節省圖像是什麼表或用戶點擊video.All細節去image_database。
可能是我的邏輯錯誤。
什麼是「不正常」?你期望發生什麼,發生了什麼? – CodeCaster 2013-04-04 10:31:57
prob --- ****兩個單選按鈕都檢查***值不插入到不同的表 – 2013-04-04 10:34:46
thnx球員的幫助.... *我固定d錯誤,使用組功能來分組兩個單選按鈕* – 2013-04-05 14:39:34