Class FormExtensions
- Namespace
- AngleSharp.Html.Dom
- Assembly
- AngleSharp.dll
A set of useful extension methods when dealing with the DOM.
public static class FormExtensions
- Inheritance
-
FormExtensions
- Inherited Members
Methods
SetValues(IHtmlFormElement, IDictionary<string, string>, bool)
Set the field values of given form by using the dictionary which contains name value pairs of input fields.
public static IHtmlFormElement SetValues(this IHtmlFormElement form, IDictionary<string, string> fields, bool createMissing = false)
Parameters
form
IHtmlFormElementThe form to set.
fields
IDictionary<string, string>The fields to use as values.
createMissing
boolWhat to do if some field(s) have not been found in the form. If true, then new input will be created. Otherwise, an exception will be thrown.
Returns
- IHtmlFormElement
The given form for chaining.
SubmitAsync(IHtmlElement, IDictionary<string, string>, bool)
Submits the form of the element by using the dictionary which contains name value pairs of input fields to submit.
public static Task<IDocument> SubmitAsync(this IHtmlElement element, IDictionary<string, string> fields, bool createMissing = false)
Parameters
element
IHtmlElementThe element to submit its form.
fields
IDictionary<string, string>The fields to use as values.
createMissing
boolWhat to do if some field(s) have not been found in the form. If true, then new input will be created. Otherwise, an exception will be thrown.
Returns
SubmitAsync(IHtmlElement, object?)
Submits the form of the element by decomposing the object into a dictionary that contains its properties as name value pairs.
public static Task<IDocument> SubmitAsync(this IHtmlElement element, object? fields = null)
Parameters
element
IHtmlElementThe element to submit its form.
fields
objectThe optional fields to use as values.
Returns
SubmitAsync(IHtmlFormElement, IDictionary<string, string>, bool)
Submits the given form by using the dictionary which contains name value pairs of input fields to submit.
public static Task<IDocument> SubmitAsync(this IHtmlFormElement form, IDictionary<string, string> fields, bool createMissing = false)
Parameters
form
IHtmlFormElementThe form to submit.
fields
IDictionary<string, string>The fields to use as values.
createMissing
boolWhat to do if some field(s) have not been found in the form. If true, then new input will be created. Otherwise, an exception will be thrown.
Returns
SubmitAsync(IHtmlFormElement, object)
Submits the given form by decomposing the object into a dictionary that contains its properties as name value pairs.
public static Task<IDocument> SubmitAsync(this IHtmlFormElement form, object fields)
Parameters
form
IHtmlFormElementThe form to submit.
fields
objectThe fields to use as values.