namespace WebApplication4
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnAdd_Click(object sender, EventArgs e)
{
if (upImage.HasFile)
{
if (CheckFileType(upImage.FileName))
{
string fielPath = " !/UploadImages/" + upImage.FileName;
upImage.SaveAs(MapPath(filePath));
}
}
}
bool CheckFileType(string fileName)
{
string ext = Path.GetExtension ( fileName);
switch (ext.ToLower())
{
case ".gif" :
return true;
case ".png:" :
return true;
case ".jpg" :
return true;
case " .jpeg" :
return true ;
default :
return false ;
}
}
void Page_Prerender()
{
string upFodler = MapPath("~/UploadImages/");
DirectoryInfo dir = new DirectoryInfo(upFolder);
dlstImages.DataSouce = dir.GetFiles();
dlstImages.DataBind();
}
}
}
Error 1 The name 'filePath' does not exist in the current context C:\Users\se7olutionyg\Documents\Visual Studio 2008\Projects\WebApplication4\WebApplication4\Default.aspx.cs 30 44 WebApplication4
this is from the text book, i understand how the system work , but don't know what do they means by filePath
Is that the way we declare the path where the pix are located
second, can anybody explain the keyword,
DirectoryInfo,DirectoryInfo(upFolder);
DataSouce