FileRecieved Event not getting fired in SharePoint

Jul 14, 2011 at 4:36 PM

I tried to use the control in SharePoint Custom UserControl. Registered Assembly both in Master Page and control once at a time (for trial).

I can see the upload control but the File Received event is not getting fired.

protected void ks_FileReceived(object sender, com.flajaxian.FileReceivedEventArgs e)       

protected void ks_FileReceived(object sender, com.flajaxian.FileReceivedEventArgs e)
            SPSite site = SPContext.Current.Site;
            SPWeb web = site.OpenWeb();
            web.AllowUnsafeUpdates = true;
            SPDocumentLibrary doc = (SPDocumentLibrary)web.Lists["SharedDocuments"];
            SPFolder objFolder = web.Folders[ViewState["folderUrl"].ToString()];
            lblError.Text += objFolder.Url.ToString() + ":";
            if (e.File.ContentLength > 0)
                System.IO.Stream strm = e.File.InputStream;

                byte[] byt = new byte[Convert.ToInt32(e.File.ContentLength)];

                strm.Read(byt, 0, Convert.ToInt32(e.File.ContentLength));
                objFolder.Files.Add(System.IO.Path.GetFileName(e.File.FileName), byt);



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Upload.aspx.cs" Inherits="Upload" %>
<%@Register Assembly="com.flajaxian.FileUploader" Namespace="com.flajaxian" TagPrefix="ks" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <ks:FileUploader ID="ks" runat="server" onfilereceived="ks_FileReceived"></ks:FileUploader>

Please Help