Hi,
I’d like to read a value of text from a textfield. When I try to access it I get an exception:
var field = document.Form["textField"];
To be sure that the field exists I tried to iterate it:
foreach (var field in document.Form.Fields)
{
... field.Name
}
The expected field exists. But when I access it by name the exception comes:
foreach (var field in document.Form.Fields)
{
var field = document.Form[field.Name];
}
The strange thing is when I try to access with LINQ everything is fine:
TextBoxField textField = document.Form.Fields.ToList().FirstOrDefault(f => f.Name.Equals("textField")) as TextBoxField;
What do I wrong?
Best regards,
Torsten