J'ai un ReorderList qui fonctionne très bien, à l'intérieur du InsertItemTemplate, j'ai ajouté un asp: fileUpload ajouter des images à la liste et la base de données. Tous ces contrôles sont à l'intérieur d'un DIV.Ajax ReordeList et asp: FileUpload Problème
Comment pourrais-je atteindre ce (asp: FileUpload) en C# pour vérifier si elle a un fichier ou non,
c'est la partie C# du code:
////// //////////////////////////////////////////////////////////////////////// ///////////////////////////////////////
protected void btnInsert_Click(object sender, EventArgs e)
{
string sFilename = Guid.NewGuid().ToString();
FileUpload filePhoto = (FileUpload)div1.FindControl("filePhoto");
if (filePhoto.HasFile)
{
string sPath = "";
string sFile = filePhoto.FileName.ToString();
sPath = Server.MapPath("Images");
filePhoto.SaveAs(sPath + "\\" + sFile);
//to fill the Notice image by code behine
ObjectDataSource1.InsertParameters["theImage"].DefaultValue = "Images\\" + sFile;
}
else
{
//to fill the Notice image by code behine
ObjectDataSource1.InsertParameters["theImage"].DefaultValue = "Images\\" + "NoImage.jpg";
}
}
//// ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// ////
des idées?
Merci à l'avance