jQWidgets Forums
Forum Replies Created
-
Author
-
February 12, 2015 at 5:05 pm in reply to: How to use jqxFileUpload in ASP.NET How to use jqxFileUpload in ASP.NET #67030
Hi JOlmos,
I was also having a similar problem getting the code-behind for VB.NET. What I used was a generic handler to do the post back to the server. Here is my code:
<%@ WebHandler Language=”VB” Class=”AjaxFileUploaderHandler” %>
Imports System
Imports System.Web
Imports System.Collections.Generic
Imports System.Linq
Imports System.IO
Imports System.Web.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Object
Imports System.Windows.Input.CursorPublic Class AjaxFileUploaderHandler : Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
‘// VB code automatically entered when class was created
‘context.Response.ContentType = “text/plain”
‘context.Response.Write(“Hello World”)Dim ws As New WebService
Dim File As HttpPostedFile = Nothing
Dim sType As String = “”
Dim bSuccess As Boolean = FalseTry
If context.Request.Files.Count > 0 Then
File = context.Request.Files(0)
ws = New WebServicebSuccess = ws.SaveAttachment(File)
End If
Catch ex As Exception
Finally
If Not IsNothing(ws) Then ws.Dispose()
ws = Nothing
File = Nothing
End Try
End SubPublic ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return True
End Get
End PropertyEnd Class
This does work for me, but I am having an issue where when I click on the browse button, the control does a post back. I’m not entirely sure what the problem is, but I thought I’d share what I did and hope that it helps.
-
AuthorPosts