Dec 06, 2011, 7:33 AM
How to get Selected file's path of FileUploadField by DirectEvents
How to get Selected file's path of FileUploadField by DirectEvents
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Upload(object sender, DirectEventArgs e)
{
string path = this.FileUploadField1.FileName;
path = MapPath(path);
X.Msg.Alert("Upload", path).Show();
}
</script>
<!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>Ext.Net Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:FileUploadField ID="FileUploadField1" runat="server" Width="200">
<DirectEvents>
<FileSelected OnEvent="Upload" />
</DirectEvents>
</ext:FileUploadField>
</form>
</body>
</html>