Skip to content

Commit 9b4435b

Browse files
authored
docs(asyncupload): fix code snippets
1 parent e3ea9c8 commit 9b4435b

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

controls/asyncupload/how-to/how-to-extend-the-radasyncupload-handler.md

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,37 @@ This article contains the following sections:
2323

2424
To create a custom handler, you must inherit the built-in `AsyncUploadHandler` class and then implement the desired functionality (for example, saving images directly to a database, without using temporary folder).
2525

26-
1. Create a generic handler in your Web Application (for example, `myHandler.ashx`)
27-
28-
1. Make sure the class extends the `Telerik.Web.UI.AsyncUploadHandler` class
29-
30-
**C#**
31-
32-
public class myHandler : Telerik.Web.UI.AsyncUploadHandler
26+
1. Create the Custom Handler
27+
28+
1. Create a generic handler in your Web Application (for example, `myHandler.ashx`)
29+
30+
1. Make sure the class extends the `Telerik.Web.UI.AsyncUploadHandler` class
31+
32+
1. Override the `Process` method
33+
34+
````C#
35+
public class CustomUploadHandler : AsyncUploadHandler
3336
{
37+
protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
38+
{
39+
// do something here
3440
41+
return base.Process(file, context, configuration, tempFileName);
42+
}
3543
}
36-
37-
**VB**
38-
39-
Public Class myHandler
40-
Inherits Telerik.Web.UI.AsyncUploadHandler
44+
````
45+
````VB
46+
Public Class CustomUploadHandler
47+
Inherits AsyncUploadHandler
4148
49+
Protected Overrides Function Process(ByVal file As UploadedFile, ByVal context As HttpContext, ByVal configuration As IAsyncUploadConfiguration, ByVal tempFileName As String) As IAsyncUploadResult
50+
'do something here
51+
52+
Return MyBase.Process(file, context, configuration, tempFileName)
53+
End Function
4254
End Class
43-
44-
1. Override the `Process` method
45-
46-
**C#**
47-
48-
protected override IAsyncUploadResult Process(UploadedFile file,
49-
HttpContext context,
50-
IAsyncUploadConfiguration configuration,
51-
string tempFileName)
52-
53-
**VB**
54-
55-
Protected Overrides Function Process(ByVal file As UploadedFile,
56-
ByVal context As HttpContext,
57-
ByVal configuration As IAsyncUploadConfiguration,
58-
ByVal tempFileName As String) As IAsyncUploadResult
59-
60-
End Function
61-
55+
````
56+
6257
1. Set the path to the custom handler in the RadAsyncUpload through its `HttpHandlerUrl` property:
6358

6459
**ASPX**

0 commit comments

Comments
 (0)