Jak wywołać następną funkcję w jquery? i jak przekazac parametry z FileUpload i TextBoxa uzywanego w jquery??
protected void Button1_Click(object sender, EventArgs e)
{
bool isExists = System.IO.Directory.Exists(Server.MapPath("~/image/kategorie/"));
if (!isExists)
System.IO.Directory.CreateDirectory(Server.MapPath("~/image/kategorie/"));
string filePath = FileUploadImage1.PostedFile.FileName;
string filename = Path.GetFileName(filePath);
string ext = Path.GetExtension(filename);
filename = TextBoxTytul.Text;
filename += ext;
if (FileUploadImage1.HasFile)
{
FileUploadImage1.SaveAs(MapPath("~/image/pomocniczy/" + filename));
}
conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Baza_danych"].ConnectionString);
conn.Open();
cmd = new SqlCommand("INSERT INTO Kategorie (NAZWA_KATEGORII, IKONA) VALUES (@NAZWA_KATEGORII, @IKONA)");
cmd.Connection = conn;
param = new SqlParameter("NAZWA_KATEGORII", System.Data.SqlDbType.NVarChar);
param.Value = TextBoxTytul.Text;
cmd.Parameters.Add(param);
param = new SqlParameter("IKONA", System.Data.SqlDbType.NVarChar);
param.Value = ("~/image/kategorie/" + filename);
cmd.Parameters.Add(param);
cmd.ExecuteNonQuery();
conn.Close();
System.IO.Directory.Delete(MapPath("~/image/pomocniczy/"), true);
Image1.ImageUrl = "";
TextBoxTytul.Text = "";
}