Cannot called or talk to code behind. vb.net

Mar 22, 2011 at 10:06 AM

 

i have the coding below on html page:

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="UploadFile.aspx.vb" Inherits="UploadFile" title="Upload FIle" %>
<%@ Register TagPrefix="fjx" Namespace="com.flajaxian" Assembly="com.flajaxian.FileUploader" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script>
function FileStateChanged(uploader, file, httpStatus, isLast){
    Flajaxian.fileStateChanged(uploader, file, httpStatus, isLast);
    var t = Flajaxian.$("MyDiv");
    if(file.state > Flajaxian.File_Uploading){
        t.innerHTML += "bytes:"+file.bytes+" name:"+file.name+" state:"+file.state+" httpStatus:"+httpStatus+" isLast:"+isLast+"</br>";
    }
}
</script>

 <div id="MyDiv"></div>
 <fjx:FileUploader ID="FileUploader1" runat="server" RequestAsPostBack="true"  JsFunc_FileStateChanged="FileStateChanged" IsDebug="true" CssUrl="~/css/FileUploader.css" TransparentBackground="true">
    <Adapters>
        <fjx:FileSaverAdapter runat="server" FolderName="UploadFolder" OnFileNameDetermining="FileNameDetermining"/>
        <fjx:ThumbGeneratorAdapter Runat="server"
            Extensions="jpg;jpeg" FolderName="UploadFolder"
            Suffix="_thumb" MaximumWidth="200" MaximumHeight="200" />
    </Adapters>
</fjx:FileUploader>

</asp:Content>

 

Everything look ok and file is uploaded successful.

i want to talk to code behind and i am using VB.NET.

OnFileNameDetermining="FileNameDetermining", i can't called code behind.

If something wrong with code behind function or something wrong with the call function?

Below is my code behind:

 

Imports UploadFile
Imports System.IO
Imports com.flajaxian

Partial Class UploadFile
    Inherits System.Web.UI.Page


    Protected Sub FileNameDetermining(ByVal sender As Object, ByVal args As FileNameDeterminingEventArgs)
        Label1.Text = "123"
        If System.IO.File.Exists(Server.MapPath("~/UploadFolder/" & args.FileName)) Then
            'Response.Write("YES")
            'args.CancelProcessing = True
            ' or if you want to stop the upload call args.CancelProcessing = true;
            args.FileName = "123.jpg"
        Else
            args.FileName = "123.jpg"
            'Response.Write("No")
        End If
    End Sub
End Class