Url WithQuery Method (Form)C# API
Initialises a new instance of the Url class using the attributes of this Url, but with query data from the specified Form object (replacing the existing query data if present).

Namespace: Facilita.Web
Assembly: clrWebBrowser (in clrWebBrowser.dll) Version: (

public Url WithQuery(
	Form form


Type: Facilita.Web Form
A collection of key/value pairs represented as a HTML form.

Return Value

A new Url object which is the same as this Url but with query data from the specified form.

The following example demonstrates adding a Form object to an existing Url.
IpEndPoint myServer = new IpEndPoint("www.myCompany.co.uk", 8080);
Url url = new Url(Protocol.HTTP, myServer, "index.php");

Form form = response.ExtractForm("contactForm");
form.GetInputElement("sessionID").Value = "12345";

Url url2 = url.WithQuery(form);
// This refers to http://www.myCompany.co.uk:8080/index.php?sessionID=12345
See Also