Input place is a pattern that specifies a tag that is to be modified. In the methods of the WebForms class, there are string parameters named InputPlace.
Note: In WebForms core technology, there is also an output place pattern, which functions similarly to the input place pattern.
1- Selection by id
2- Selection by name
3- Selection by tag name
4- Selection by class name
5- Selection by query
6- Selection of multiple tags by query
We can also nest the above input places
The InputPlace class is a class that is added in the same file as the WebForms class. The InputPlace class has static methods that can access all 6 modes for selecting tags.
2- Writing the input place pattern directlyWriting the input place pattern directly is more professional and produces less code, but it may be difficult for beginners to understand.
The code below shows an HTML page, and the examples that follow are based on this page.
ExampleUsing the Id method on the InputPlace class, we can set the InputPlace parameter in the methods of the WebForms class.
InputPlace.Id(Id)
Example:
By writing the input place pattern directly, we can also set the InputPlace parameter in the methods of the WebForms class. The id string is written directly.
Id
Example:
Selecting by nameUsing the Name method on the InputPlace class, we can set the InputPlace parameter in the methods of the WebForms class.
InputPlace.Name(Name, {Index})
Example:
You can also specify the index. If you don't specify the index, 0 is assumed and it will determine the first tag.By writing the input place pattern directly, we can also set the InputPlace parameter in the methods of the WebForms class. The name string is written inside open and close parentheses.
(Name)
Example:
You can also specify the index. The number written after the parentheses specifies the index. If you don't specify the index, 0 is assumed and it will determine the first tag.Using the Tag method on the InputPlace class, we can set the InputPlace parameter in the methods of the WebForms class.
InputPlace.Tag(Tag, {Index})
Example:
You can also specify the index. If you don't specify the index, 0 is assumed and it will determine the first tag.By writing the input place pattern directly, we can also set the InputPlace parameter in the methods of the WebForms class. The tag name is written between the less than and greater than characters.
<Tag>
Example:
You can also specify the index. The number written after the greater than character specifies the index. If you don't specify the index, 0 is assumed and it will determine the first tag.Using the Class method on the InputPlace class, we can set the InputPlace parameter in the methods of the WebForms class.
InputPlace.Class(Class, {Index})
Example:
You can also specify the index. If you don't specify the index, 0 is assumed and it will determine the first tag.By writing the input place pattern directly, we can also set the InputPlace parameter in the methods of the WebForms class. The class name is written between the braces characters.
{Class}
Example:
You can also specify the index. The number that is written after the closing bracket character determines the index. If you don't specify the index, 0 is assumed and it will determine the first tag.Using the Query method on the InputPlace class, we can set the InputPlace parameter in the methods of the WebForms class.
InputPlace.Query(Query)
Example:
By writing the input place pattern directly, we can also set the InputPlace parameter in the methods of the WebForms class. The asterisk character must be written before writing the query string.
*Query
Example:
Note: When writing the query pattern directly, you must use the string (Selecting by query all$[eq];
) instead of the equals character (=
).
Using the QueryAll method on the InputPlace class, we can set the InputPlace parameter in the methods of the WebForms class. Using this method, we can select multiple tags
InputPlace.QueryAll(Query)
Example:
By writing the input place pattern directly, we can also set the InputPlace parameter in the methods of the WebForms class. The open square brackets character must be written before writing the query string.
[Query
Example:
Note: When writing the query all pattern directly, you must use the string (Selecting by nested input place$[eq];
) instead of the equals character (=
).
Using the AppendPlace extension method on the InputPlace class, we can set the InputPlace parameter in the methods of the WebForms class. Using this method, we can select the label through the parent.
InputPlace.AppendPlace(InputPlace)
Example:
By writing the input place pattern directly, we can also set the InputPlace parameter in the methods of the WebForms class. Each input place must be separated by a vertical bar character.
|
Example: