Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: AjaxFileUpload error (red) after upload [27271]

$
0
0
Hi, I'm having problems with using the AjaxFileUpload control.
VS2008 - .NET framework 3.5. Placed the AjaxFileUpload control, and changed the aspx and code behind like given below. This is what happens after running:

1) Select -> file, the filename is correct displayed
The filename (pending)
2) Upload -> after clicking the upload button the filename textbox get red colored and is showing
The filename (errror)

The thing I don't understand is why the UploadComplete event (in code behind file) never get hit. Direct after clicking the upload button the message "error" is shown in red. What can be the cause of this, it looks al so basic, but it is causing me headaches.

Any help is appreciated.
Coen

-----------------------------------------------------------------------------------------------------------------
*** Code (aspx) ***
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>

<div>
<asp:Label runat="server" ID="myThrobber" Style="display: none;"><img alt="" src="Images/ajax-loader.gif"/></asp:Label>
<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server"
OnUploadComplete="AjaxFileUpload1_UploadComplete" ThrobberID="myThrobber" MaximumNumberOfFiles="10"/>
</div>
</form>
</body>
</html>

*** Code (C#) ***
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
string filePath = "~/upload/" + e.FileName;
AjaxFileUpload1.SaveAs(filePath);
}
}
-----------------------------------------------------------------------------------------------------------------
Comments: Hi I have seen the solution on above link. I am using visual studio 2010 and .net frame work 4.0 but still i am getting same error 1) Select -> file, the filename is correct displayed The filename (pending) 2) Upload -> after clicking the upload button the filename textbox get red colored and is showing The filename (errror) Please Give a solution

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>