AgileDotNetHtml 1.0.2
See the version list below for details.
dotnet add package AgileDotNetHtml --version 1.0.2
NuGet\Install-Package AgileDotNetHtml -Version 1.0.2
<PackageReference Include="AgileDotNetHtml" Version="1.0.2" />
paket add AgileDotNetHtml --version 1.0.2
#r "nuget: AgileDotNetHtml, 1.0.2"
// Install AgileDotNetHtml as a Cake Addin #addin nuget:?package=AgileDotNetHtml&version=1.0.2 // Install AgileDotNetHtml as a Cake Tool #tool nuget:?package=AgileDotNetHtml&version=1.0.2
Agile Dot Net Html
Table of Contents
Introduction
I believe that have many great libraries for working whit HTML in C#, but here is a good alternative. AgileDotNetHtml is a library that gives features as parsing and building HTML. The library allow you convert HTML to C# objects represent this HTML and Build these object to HTML string again. There is a rich set of C# object which represent HTML elements and their attributes by w3 school HTML 5 standard. The idea of this project is to allow you fast and easy create and edit composite HTML structures.
Getting Started
Parse Page
- Load and parse page from specific url.
HtmlParser parser = new HtmlParser();
HtmlDocument documnet = parser.ParsePageFromUrl(path);
Parse String
- Parse specific HTML string
string htmlString = "<div class='some element'><ul class='ul'><li></li><li></li></ul></div>";
HtmlParser parser = new HtmlParser();
IHtmlElementsCollection elements = parser.ParseString(htmlString);
Build Html Content
- Create HTML content containing form elements whit different kinds of inputs.
HtmlFormElement formElement = new HtmlFormElement();
HtmlInputElement textInput = new HtmlInputElement("text");
textInput.Name = "TextInput";
textInput.Value = "Some value";
HtmlInputElement radioInput = new HtmlInputElement("radio");
radioInput.Name = "RadioInput";
radioInput.Value = "Some value";
HtmlTextareaElement textArea = new HtmlTextareaElement();
textArea.Name = "TextArea";
textArea.Text("Some text...");
formElement.Append(radioInput);
formElement.Append(textInput);
formElement.Append(textArea);
HtmlBuilder builder = new HtmlBuilder();
IHtmlContent formHtmlContent = builder.CreateHtmlContent(formElement);
Authors
Atanas Galchov
License
AgileDotNetHtml
is open source software licensed as MIT
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- Microsoft.AspNetCore.Html.Abstractions (>= 2.1.1)
- Microsoft.Extensions.Http (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.