TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rahul Prajapat
NA
1.6k
638.6k
FileUpload control within UpdatePanel in asp.net
Jun 17 2015 10:30 PM
My source file is:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Upload" onclick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
and code behind code is:
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string Prefix = DateTime.Now.ToString("ddMMyyhhmmsstt");
string Doc_Name = (Path.GetFileName(FileUpload1.PostedFile.FileName)).Split('.')[0].ToString();
string str = FileUpload1.FileName;
string targetPath = Server.MapPath("~\\images\\Docs\\") + Prefix + FileUpload1.FileName;
FileUpload1.SaveAs(targetPath);
}
}
My problem is that FileUpload1.HasFile return false, why ?
And how can fix it and save the file in folder.
Please help me...
Thanks in advance.
Reply
Answers (
9
)
Los Cafeteros will hope to turn the tables at the Estadio Mo
datavisualization - Audiometric chart