AjaxNetProfessional 24.10.10.1
dotnet add package AjaxNetProfessional --version 24.10.10.1
NuGet\Install-Package AjaxNetProfessional -Version 24.10.10.1
<PackageReference Include="AjaxNetProfessional" Version="24.10.10.1" />
paket add AjaxNetProfessional --version 24.10.10.1
#r "nuget: AjaxNetProfessional, 24.10.10.1"
// Install AjaxNetProfessional as a Cake Addin #addin nuget:?package=AjaxNetProfessional&version=24.10.10.1 // Install AjaxNetProfessional as a Cake Tool #tool nuget:?package=AjaxNetProfessional&version=24.10.10.1
Ajax.NET Professional
Ajax.NET Professional (AjaxPro) is one of the first AJAX frameworks available for Microsoft ASP.NET.
The framework will create proxy JavaScript classes that are used on client-side to invoke methods on the web server with full data type support working on all common web browsers including mobile devices. Return your own classes, structures, DataSets, enums,... as you are doing directly in .NET.
Quick Guide
- Download the latest Ajax.NET Professional
- Add a reference to the AjaxPro.2.dll (for the .NET 1.1 Framework use AjaxPro.dll)
- Add following lines to your web.config
<configuration>
<system.web>
<httpHandlers>
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
</httpHandlers>
</system.web>
</configuration>
- Now, you have to mark your .NET methods with an AjaxMethod attribute
[AjaxPro.AjaxMethod]
public DateTime GetServerTime()
{
return DateTime.Now;
}
- To use the .NET method on the client-side JavaScript you have to register the methods, this will be done to register a complete class to Ajax.NET
namespace MyDemo
{
public class DefaultWebPage
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(DefaultWebPage));
}
[AjaxPro.AjaxMethod]
public static DateTime GetServerTime()
{
return DateTime.Now;
}
}
}
- If you start the web page two JavaScript includes are rendered to the HTML source
- To call a .NET method form the client-side JavaScript code you can use following syntax
function getServerTime() {
MyDemo.DefaultWebPage.GetServerTime(getServerTime_callback); // asynchronous call
}
// This method will be called after the method has been executed
// and the result has been sent to the client.
function getServerTime_callback(res) {
alert(res.value);
}
Compiler Options
NET20
compiles .NET 2.0 assemblies AjaxPro.2.dll (otherwise original it was .NET 1.1, AjaxPro.dll)JSONLIB
compiles JSON parser only (AjaxPro.JSON.2.dll or AjaxPro.JSON.dll)NET20external
is setting the assembly name to AjaxPro.2.dll, compatibilityTRACE
is no longer used
Security Settings
In web.config you can configure different security related settings.
One of the most important is to set a Content-Security-Policy HTTP response header to ensure to trust only JavaScript and other resources that are coming from your web server or trusted locations. As AjaxPro is generating some JavaScript files on-the-fly you can set the JavaScript nonce in your web.config:
<configuration>
<ajaxNet>
<ajaxSettings>
<contentSecurityPolicy nonce="abcdefghijklmnopqrstuvwxyz" />
</ajaxSettings>
</ajaxNet>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Content-Security-Policy"
value="frame-ancestors www.mydomain.com; script-src 'self' https://www.mydomain.com 'unsafe-eval' 'unsafe-hashes' 'nonce-abcdefghijklmnopqrstuvwxyz';" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Serialization settings
For security reasons, AjaxPro does not allow serialization/deserialization of arbitrary .NET classes in its default settings. Serialization support for individual classes or namespaces can be enabled within the "web.config", using the jsonDeserializationCustomTypes
setting:
<configuration>
<ajaxNet>
<ajaxSettings>
<jsonDeserializationCustomTypes default="deny">
<allow>MyOwnNamespace.*</allow>
</jsonDeserializationCustomTypes>
</ajaxSettings>
</ajaxNet>
...
</configuration>
It is further possible to generally enable serialization support for all .NET classes and only block the deserialization of specifc "dangerous" classes. However, this is not recommended as you need to maintain a list of dangerous classes.
<configuration>
<ajaxNet>
<ajaxSettings>
<jsonDeserializationCustomTypes default="allow">
<deny>System.Configuration.Install.AssemblyInstaller</deny>
</jsonDeserializationCustomTypes>
</ajaxSettings>
</ajaxNet>
...
</configuration>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net20 is compatible. net35 was computed. net40 was computed. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 4.8
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
24.10.10.1 | 397 | 10/10/2024 | |
23.5.10.1 | 861 | 5/10/2023 | |
23.5.5.1 | 447 | 5/5/2023 | |
22.3.20.1 | 7,470 | 3/20/2022 | |
21.12.22.1 | 1,151 | 12/22/2021 | |
21.12.21.1 | 1,001 | 12/21/2021 | |
21.12.8.1 | 1,039 | 12/8/2021 | |
21.11.29 | 2,056 | 12/3/2021 | |
21.11.22 | 1,201 | 11/22/2021 | |
21.10.30 | 1,495 | 11/22/2021 |