AgileDotNetHtml 1.0.2

There is a newer version of this package available.
See the version list below for details.
Install-Package AgileDotNetHtml -Version 1.0.2
dotnet add package AgileDotNetHtml --version 1.0.2
<PackageReference Include="AgileDotNetHtml" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AgileDotNetHtml --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AgileDotNetHtml, 1.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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

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
1.0.3 193 5/8/2021
1.0.2 102 4/27/2021
1.0.1 106 4/20/2021
1.0.0 95 4/20/2021