hi
this is my button event code
protected void ImageButton2_Click1(object sender, ImageClickEventArgs e)
{
string data = Server.UrlDecode(Request.QueryString["BehCode3"]);
string filename = System.IO.Path.GetFileName(fup1.PostedFile.FileName);
string filename1 = System.IO.Path.GetFileName(fup2.PostedFile.FileName);
string filename2 = System.IO.Path.GetFileName(fup3.PostedFile.FileName);
string price = RadioButton2.Checked ? TextBox1.Text : "noprice";
SqlCommand _cmd = new SqlCommand("insertproduct", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
_cmd.Parameters.AddWithValue("@Name", txtname.Text);
_cmd.Parameters.AddWithValue("@Model", txtmodel.Text);
_cmd.Parameters.AddWithValue("@Description", CKEditorControl1.Text);
_cmd.Parameters.AddWithValue("@Price", price);
_cmd.Parameters.AddWithValue("@Classification", DDL1.SelectedItem.Text);
_cmd.Parameters.AddWithValue("@subset", DDL1.SelectedItem.Text);
_cmd.Parameters.AddWithValue("@behcode", data);
_cmd.Parameters.AddWithValue("@image", filename);
_cmd.Parameters.AddWithValue("@image1", filename1);
_cmd.Parameters.AddWithValue("@image2", filename2);
_cmd.ExecuteNonQuery();
_cn.Close();
Response.Redirect(Request.Url.AbsoluteUri);
}
when i click on button this error occur
protected void ImageButton2_Click1(object sender, ImageClickEventArgs e)
{
string data = Server.UrlDecode(Request.QueryString["BehCode3"]);
string filename = System.IO.Path.GetFileName(fup1.PostedFile.FileName);
string filename1 = System.IO.Path.GetFileName(fup2.PostedFile.FileName);
string filename2 = System.IO.Path.GetFileName(fup3.PostedFile.FileName);
string price = RadioButton2.Checked ? TextBox1.Text : "noprice";
SqlCommand _cmd = new SqlCommand("insertproduct", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
_cmd.Parameters.AddWithValue("@Name", txtname.Text);
_cmd.Parameters.AddWithValue("@Model", txtmodel.Text);
_cmd.Parameters.AddWithValue("@Description", CKEditorControl1.Text);
_cmd.Parameters.AddWithValue("@Price", price);
_cmd.Parameters.AddWithValue("@Classification", DDL1.SelectedItem.Text);
_cmd.Parameters.AddWithValue("@subset", DDL1.SelectedItem.Text);
_cmd.Parameters.AddWithValue("@behcode", data);
_cmd.Parameters.AddWithValue("@image", filename);
_cmd.Parameters.AddWithValue("@image1", filename1);
_cmd.Parameters.AddWithValue("@image2", filename2);
_cmd.ExecuteNonQuery();
_cn.Close();
Response.Redirect(Request.Url.AbsoluteUri);
}
what should i do?
thanks