# ConditionalInstructionCollection.Remove Method

> Removes that ConditionalInstruction element from the collection and the document, where the Name property value equals the specified name.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > ConditionalInstructionCollection.Remove Method
- **588 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/conditionalinstructioncollection/remove-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/conditionalinstructioncollection/remove-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/conditionalinstructioncollection/remove-method/llms-full.txt

---

### Description

Removes that [ConditionalInstruction](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/conditionalinstruction/llms-full.txt) element from the collection and the document, where the [Name](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/conditionalinstruction/name-property/llms-full.txt) property value equals the specified name.

### Syntax

```csharp
public bool Remove(string name);
```

```vbnet
Public Function Remove(name As String) As Boolean
```

### Parameters

| Parameter | Description |
|---|---|
| name | Specifies the name of the `ConditionalInstruction` element to remove. |

### Return Value

The return value is true, if the specified `ConditionalInstruction` element was found and removed. Otherwise false. A `ConditionalInstruction` element won't be removed, if the [TextControl.IsFormFieldValidationEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/isformfieldvalidationenabled-property/llms-full.txt) property is set to false or the [TextControl.EditMode](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/editmode-property/llms-full.txt) is set to `EditMode.ReadAndSelect` and [TextControl.DocumentPermissions.ReadOnly](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/documentpermissions/readonly-property/llms-full.txt) to true.

### Examples

The following example removes an item from the conditional instruction collection.

```csharp
if (conditionalInstructionCollection.Remove("CustomerName"))
{
    Console.WriteLine("Remove completed successfully.");
}
```

```vbnet
If conditionalInstructionCollection.Remove("CustomerName") Then
    Console.WriteLine("Remove completed successfully.")
End If
```

---

## Nearby

- **Previous:** [ConditionalInstructionCollection.IsValueValid Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/conditionalinstructioncollection/isvaluevalid-method/llms-full.txt)
- **Next:** [ContextMenuLocation Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/contextmenulocation/enumeration/llms-full.txt)
