I'm sure this is simple but I'm missing something and I can't figure out what. I'm just trying to get my function to respond when I click on a button within a ajax panel. Here is my aspx.
And here is my vb. What am I missing
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="admin_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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
>Untitled Page</
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
HorizontalAlign
=
"NotSet"
>
Please select a file:
<
asp:FileUpload
ID
=
"FileUpload1"
runat
=
"server"
/><
br
/>
<
asp:Button
ID
=
"upload"
Text
=
"Upload"
runat
=
"server"
/><
br
/>
<
asp:Label
ID
=
"output"
runat
=
"server"
></
asp:Label
>
</
telerik:RadAjaxPanel
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Height
=
"75px"
Transparency
=
"10"
BackgroundPosition
=
"Center"
>
<
img
alt
=
"Loading..."
src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.LoadingProgressBar.gif") %>'
style="border: 0px;" />
</
telerik:RadAjaxLoadingPanel
>
</
div
>
</
form
>
</
body
>
</
html
>
And here is my vb. What am I missing
Partial
Class
admin_Default
Inherits
System.Web.UI.Page
Protected
Sub
upload_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
upload.Click
Response.Write(
"test"
)
If
(FileUpload1.HasFile)
Then
Try
Dim
name
As
String
= FileUpload1.FileName.ToString
Dim
ext
As
String
= System.IO.Path.GetExtension(FileUpload1.FileName)
If
(ext =
".csv"
)
Then
FileUpload1.SaveAs(Server.MapPath(
"~/admin/temp/"
& name))
Else
output.Text =
"<span style='color: red;'>Invalid file type. File must be CSV.</span>"
End
If
'if ext = .csv
Catch
ex
As
Exception
Response.Write(ex.ToString)
End
Try
'fileupload.hasfile
Else
output.Text = (
"<span style='color: red;'>Please make sure you have selected a file and the size is greater than 0 bytes.</span>"
)
End
If
'fileupload.hasfile
End
Sub
End
Class