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
Bilawal Niaz
NA
110
16.4k
File upload not working....!
Jun 11 2016 5:54 AM
salam
file uploader send images in database when i not apply ajax,
but when i apply ajax than, file upload not send the image into database.
any one tell me why?
code is here:
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%>
</Scripts>
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
<div>
<tr> <td>Image :</td> <td style="width: 235px">
<asp:FileUpload ID="FileUpload1" runat="server" CssClass="form-control" Height="40px" Width="220px" />
<br />
</td>
</tr>
</div>
</ContentTemplate></asp:UpdatePanel>
Backend coding is:
obj.Image = FileUpload1.FileName;
Random r = new Random();
long s = r.Next(10000, 200000);
obj.Image = s + FileUpload1.FileName;
string path = Server.MapPath(@"Images/" + s + FileUpload1.FileName);
FileUpload1.SaveAs(path);
Reply
Answers (
6
)
Ajax and jquery not work in mozilla firefox Browser
validation calling