Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions xml/System.Web.UI/ClientIDMode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@

This example creates HTML with three `ProductIDLabel` controls. When the page runs, the IDs for the controls will be the following:

- `ListView1_ProductIDLabel_1`
- `ListView1_ProductIDLabel_34`
- `ListView1_ProductIDLabel_43`
- `ListView1_ProductIDLabel_1`
- `ListView1_ProductIDLabel_34`
- `ListView1_ProductIDLabel_43`

[!code-aspx-csharp[System.Web.UI.ClientIDMode#11](~/samples/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/predictable.aspx#11)]

]]></format>
</remarks>
Expand Down
20 changes: 10 additions & 10 deletions xml/System.Web.UI/Control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -718,15 +718,15 @@ span#ProductIDLabel { background-color: white; }

The following example shows the user control.


[!code-aspx-csharp[System.Web.UI.ClientIDMode#1](~/samples/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/seasons.ascx)]

The following example shows the content page that contains the user control.


[!code-aspx-csharp[System.Web.UI.ClientIDMode#2](~/samples/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/seasons.aspx)]

The following example shows the master page that contains the content page.


[!code-aspx-csharp[System.Web.UI.ClientIDMode#3](~/samples/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/seasons.master)]

]]></format>
</remarks>
Expand Down Expand Up @@ -789,15 +789,14 @@ span#ProductIDLabel { background-color: white; }


## Examples
The following example shows <xref:System.Web.UI.WebControls.Label> controls that are contained in a <xref:System.Web.UI.WebControls.ListView> control. On the <xref:System.Web.UI.WebControls.ListView> control, the <xref:System.Web.UI.Control.ClientIDMode%2A> property is set to <xref:System.Web.UI.ClientIDMode.Predictable> and the <xref:System.Web.UI.WebControls.ListView.ClientIDRowSuffix%2A> property is set to `ProductID`. In the rendered HTML, this creates three `span` elements that correspond to three `ProductIDLabel` controls. When the page runs, the `id` attributes for the `span` elements are set to the following values:

- `ListView1_ProductIDLabel_1`

- `ListView1_ProductIDLabel_34`

- `ListView1_ProductIDLabel_43`
The following example shows <xref:System.Web.UI.WebControls.Label> controls that are contained in a <xref:System.Web.UI.WebControls.ListView> control. On the <xref:System.Web.UI.WebControls.ListView> control, the <xref:System.Web.UI.Control.ClientIDMode%2A> property is set to <xref:System.Web.UI.ClientIDMode.Predictable> and the <xref:System.Web.UI.WebControls.ListView.ClientIDRowSuffix%2A> property is set to `ProductID`. In the rendered HTML, this creates three `span` elements that correspond to three `ProductIDLabel` controls. When the page runs, the `id` attributes for the `span` elements are set to the following values:

- `ListView1_ProductIDLabel_1`
- `ListView1_ProductIDLabel_34`
- `ListView1_ProductIDLabel_43`

[!code-aspx-csharp[System.Web.UI.ClientIDMode#11](~/samples/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/predictable.aspx#11)]

]]></format>
</remarks>
Expand Down Expand Up @@ -1669,7 +1668,8 @@ span#ProductIDLabel { background-color: white; }
## Examples
The following example creates an event, named `Click`, that adds and removes handlers from the control's <xref:System.ComponentModel.EventHandlerList> collection when the event is called from a page.

**Note** This example optimizes how a control adds and removes events from the list of them that the control maintains. If you create custom control and want to define an event, use code similar to this. This technique can be used in C#, but not in Visual Basic.
> [!NOTE]
> This example optimizes how a control adds and removes events from the list of them that the control maintains. If you create custom control and want to define an event, use code similar to this. This technique can be used in C#, but not in Visual Basic.

[!code-csharp[System.Web.UI.Page_VerifyRenderingInServerForm#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.Page_VerifyRenderingInServerForm/CS/testlinkbutton.cs#1)]

Expand Down