S
sandya
here is the code i tried
string ss;
//FileUpload FileUpload1 = new FileUpload();
Label Labeltxt = new Label();
//FileUpload1 = FormView1.FindControl("FileUpLoad1") as
FileUpload;
FileUpload FileUpload1 =
(FileUpload)FormView1.Row.FindControl("UploadMB");
ss = FileUpload1.ID.ToString();
Labeltxt = FormView1.FindControl("lblfileupload") as Label;
if (FileUpload1.HasFile)
{
int id = objmsg.GetMessageBoardLastID();
string fName = "MSG" + id +
Path.GetExtension(FileUpload1.PostedFile.FileName);
string fPath = Server.MapPath(Request.ApplicationPath) +
"\\MessageBoard\\" + fName;
FileUpload1.SaveAs(fPath);
Labeltxt.Text = "Received " + FileUpload1.FileName;
}
else
{
Labeltxt.Text = "No uploaded file";
}
but the fileupload1.hasfile shows false even if i selected file.why
this come.pls give a solution for that.
string ss;
//FileUpload FileUpload1 = new FileUpload();
Label Labeltxt = new Label();
//FileUpload1 = FormView1.FindControl("FileUpLoad1") as
FileUpload;
FileUpload FileUpload1 =
(FileUpload)FormView1.Row.FindControl("UploadMB");
ss = FileUpload1.ID.ToString();
Labeltxt = FormView1.FindControl("lblfileupload") as Label;
if (FileUpload1.HasFile)
{
int id = objmsg.GetMessageBoardLastID();
string fName = "MSG" + id +
Path.GetExtension(FileUpload1.PostedFile.FileName);
string fPath = Server.MapPath(Request.ApplicationPath) +
"\\MessageBoard\\" + fName;
FileUpload1.SaveAs(fPath);
Labeltxt.Text = "Received " + FileUpload1.FileName;
}
else
{
Labeltxt.Text = "No uploaded file";
}
but the fileupload1.hasfile shows false even if i selected file.why
this come.pls give a solution for that.