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
6 changes: 2 additions & 4 deletions xml/System.Threading.Tasks/TaskCompletionSource`1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,11 @@
<format type="text/markdown"><![CDATA[

## Remarks
In many scenarios, it is useful to enable a <xref:System.Threading.Tasks.Task%601> to represent an external asynchronous operation. <xref:System.Threading.Tasks.TaskCompletionSource%601> is provided for this purpose. It enables the creation of a task that can be handed out to consumers. The consumers can use the members of the task the same way as they would in any other scenario handling task member variables. However, unlike most tasks, the state of a task created by a TaskCompletionSource is controlled explicitly by the methods on TaskCompletionSource. This enables the completion of the external asynchronous operation to be propagated to the underlying Task. The separation also ensures that consumers are not able to transition the state without access to the corresponding TaskCompletionSource. For more information, see the entry [The Nature of TaskCompletionSource\<TResult>](https://devblogs.microsoft.com/pfxteam/the-nature-of-taskcompletionsourcetresult/) in the Parallel Programming with .NET blog.

The [Parallel Extensions samples](https://go.microsoft.com/fwlink/?LinkID=165717) also contain examples of how to use <xref:System.Threading.Tasks.TaskCompletionSource%601>.


In many scenarios, it's useful to enable a <xref:System.Threading.Tasks.Task%601> to represent an external asynchronous operation. <xref:System.Threading.Tasks.TaskCompletionSource%601> is provided for this purpose. It enables the creation of a task that can be handed out to consumers. The consumers can use the members of the task the same way as they would in any other scenario handling task member variables. However, unlike most tasks, the state of a task created by a TaskCompletionSource is controlled explicitly by the methods on TaskCompletionSource. This enables the completion of the external asynchronous operation to be propagated to the underlying Task. The separation also ensures that consumers are not able to transition the state without access to the corresponding TaskCompletionSource. For more information, see the entry [The Nature of TaskCompletionSource\<TResult>](https://devblogs.microsoft.com/pfxteam/the-nature-of-taskcompletionsourcetresult/) in the Parallel Programming with .NET blog.

## Examples

The following example shows how to use a <xref:System.Threading.Tasks.TaskCompletionSource%601>:

:::code language="csharp" source="~/snippets/csharp/System.Threading.Tasks/TaskCompletionSourceTResult/Overview/taskcompletionsource.cs" id="Snippet01":::
Expand Down
64 changes: 26 additions & 38 deletions xml/System.Web.DynamicData/DynamicFilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
<format type="text/markdown"><![CDATA[

## Remarks
In this topic:
In this article:

- [Introduction](#introduction)

- [ClassContext](#ClassContext)

- [Declarative Syntax](#DeclarativeSyntax)
- [Introduction](#introduction)
- [ClassContext](#ClassContext)
- [Declarative Syntax](#DeclarativeSyntax)

<a name="introduction"></a>
## Introduction
Expand All @@ -51,7 +49,6 @@
You can specify the filter template to use in the following ways:

- By using the <xref:System.Web.DynamicData.DynamicFilter.FilterUIHint%2A> property in page markup. This approach is a presentation-layer customization, which is independent of the schema (database), and which applies to a single page.

- By using the <xref:System.ComponentModel.DataAnnotations.FilterUIHintAttribute> attribute in the model. This approach is a data-layer customization, which depends on the specific schema (database), and which applies to the entire application.

If you use both approaches, the filter template that is specified in the markup takes precedence over the template that is specified in the data model.
Expand All @@ -62,46 +59,37 @@

The following figure shows the steps that Dynamic Data follows in order to implement table row filtering by a foreign-key column.

![Dynamic Data Query Elements](~/add/media/dynamic-dataquery.png "Dynamic Data Query Elements")

1. The <xref:System.Web.DynamicData.DynamicFilter> control passes the selected value to the <xref:System.Web.UI.WebControls.QueryExtender> control.

2. The <xref:System.Web.UI.WebControls.QueryExtender> control uses the value to create the query filtering information. It then passes this information to the data source control.

3. The data source control passes the filtering query information to the data source provider.
![Dynamic Data Query Elements](~/add/media/dynamic-dataquery.png)

4. The data source provider passes the query to the database.

5. The database returns the filtered table rows.

6. The data source provider sends this data back to the data source control.

7. The data source control passes the filtered table rows to the data-bound control for display.
1. The <xref:System.Web.DynamicData.DynamicFilter> control passes the selected value to the <xref:System.Web.UI.WebControls.QueryExtender> control.
2. The <xref:System.Web.UI.WebControls.QueryExtender> control uses the value to create the query filtering information. It then passes this information to the data source control.
3. The data source control passes the filtering query information to the data source provider.
4. The data source provider passes the query to the database.
5. The database returns the filtered table rows.
6. The data source provider sends this data back to the data source control.
7. The data source control passes the filtered table rows to the data-bound control for display.

<a name="DeclarativeSyntax"></a>
## Declarative Syntax

```
```xml
<asp:DynamicFilter
    ID="Control ID"
    DataField="Name of the data field to use for filtering"
    EnableViewState="True|False"
    FilterUIHint="Name of the filter template to generate the UI"
    OnFilterChanged="Filter changed event handler"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnPreRender="PreRender event handler"
    OnUnload="Unload event handler"
    Visible="True|False"
    runat="server"/>
ID="Control ID"
DataField="Name of the data field to use for filtering"
EnableViewState="True|False"
FilterUIHint="Name of the filter template to generate the UI"
OnFilterChanged="Filter changed event handler"
OnDataBinding="DataBinding event handler"
OnDisposed="Disposed event handler"
OnInit="Init event handler"
OnLoad="Load event handler"
OnPreRender="PreRender event handler"
OnUnload="Unload event handler"
Visible="True|False"
runat="server"/>
```



## Examples
A Visual Studio project with source code is available at this location: [Download](https://go.microsoft.com/fwlink/?LinkId=168914).

The following examples use the default ForeignKey.ascx filter template to create the UI for filtering the Products table rows by the ProductCategory foreign-key column. When the user selects a ProductCategory value, only the rows that contain that value are displayed.

Expand Down
24 changes: 9 additions & 15 deletions xml/System.Web.DynamicData/DynamicHyperLink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
<format type="text/markdown"><![CDATA[

## Remarks
In this topic:
In this article:

- [Introduction](#introduction)

- [Declarative Syntax](#declarative_syntax)

<a name="introduction"></a>
Expand All @@ -46,31 +45,26 @@
The <xref:System.Web.DynamicData.DynamicHyperLink> control enables you to create the following links:

- Table row data-bound links, which are for data-item specific action links such as "Edit" and "Details". Dynamic Data infers the table and the primary key from the current row. An example of these links is in the Edit.aspx page of a Dynamic Data Web site.

- Links to <xref:System.Web.DynamicData.MetaTable> objects, which are specific action links such as "List" and "Insert" that in turn point to objects such as tables. An example of these links is in the Default.aspx page of a Dynamic Data Web site.

- Unbound links, which create table action links outside a data-bound control. An example of these links is in the Insert link in the List.aspx page template of a Dynamic Data Web site. Because these links are not part of a data-bound control that has a defined data context, you must specify the table to access and the action to perform. If you specify "Edit" or "Details" as the action, you must also provide the primary key.

The <xref:System.Web.DynamicData.DynamicHyperLink> control supports additional markup attributes then can be forwarded to the routing engine when the link is activated. This can be useful when you want to have an item-specific link from a non-data-bound context.

<a name="declarative_syntax"></a>
## Declarative Syntax

```
```xml
<asp:DynamicHyperlink
    ID="string"
    Action="Details|Edit|Insert|List"
    ContextTypeName="string"
    DataField="string"
    TableName="string"
    OnDataBinding="DataBinding event handler"
    OnPreRender="PreRender event handler"/>
ID="string"
Action="Details|Edit|Insert|List"
ContextTypeName="string"
DataField="string"
TableName="string"
OnDataBinding="DataBinding event handler"
OnPreRender="PreRender event handler"/>
```



## Examples
A Visual Studio project with source code is available to accompany this topic: [Scaffolding Dynamic Data](https://go.microsoft.com/fwlink/?LinkId=168914).

The following examples show how to create <xref:System.Web.DynamicData.DynamicHyperLink> controls for data rows, for a collection, and to perform the specified action.

Expand Down
12 changes: 4 additions & 8 deletions xml/System.Web.DynamicData/DynamicRouteExpression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,21 @@
<a name="DeclarativeSyntax"></a>
## Declarative Syntax

```
```xml
<asp:DynamicRouteExpression
  ColumnName="Name of the foreign key column"/>
ColumnName="Name of the foreign key column"/>
```



## Examples
A Visual Studio project with source code is available to accompany this topic: [Scaffolding Dynamic Data](https://go.microsoft.com/fwlink/?LinkId=168914).

The following example shows a custom List.aspx page template for the Products table. It uses the <xref:System.Web.DynamicData.DynamicRouteExpression.ColumnName%2A> property to specify the ProductCategory foreign key for filtering the Products rows.

The custom List.aspx page displays a column that contains links of the categories that are contained by the ProductCategory foreign-key column. When the user clicks one of these links, the List.aspx page displays only the rows that contain the selected category.

The example requires the following:

- A Dynamic Data Web site. For more information, see [Walkthrough: Creating a New Dynamic Data Web Site Using Scaffolding](https://msdn.microsoft.com/library/1564aef2-9103-436a-9806-c8ad7abd616a).

- The AdventureWorksLT sample database. For more information, see [How to: Connect to the AdventureWorksLT Database using an .MDF File](https://msdn.microsoft.com/library/d34ffbac-607d-40f1-b088-0a3304ea032b).
- A Dynamic Data Web site. For more information, see [Walkthrough: Creating a New Dynamic Data Web Site Using Scaffolding](https://learn.microsoft.com/previous-versions/cc488469(v=vs.140)).
- The AdventureWorksLT sample database.

:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.web.dynamicdata.dynamicrouteexpression/cs/list.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.web.dynamicdata.dynamicrouteexpression/vb/list.aspx" id="Snippet1":::
Expand Down
57 changes: 22 additions & 35 deletions xml/System.Web.DynamicData/QueryableFilterRepeater.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@
<format type="text/markdown"><![CDATA[

## Remarks
In this topic:
In this article:

- [Introduction](#introduction)

- [Class Context](#ClassContext)

- [Declarative Syntax](#DeclarativeSyntax)

<a name="introduction"></a>
Expand All @@ -65,50 +63,39 @@

The following figure shows the steps that Dynamic Data follows in order to implement automatic table row filtering.

![Dynamic Data Table Row Filtering Elements](~/add/media/dynamic-autofilter.png "Dynamic Data Table Row Filtering Elements")

1. The <xref:System.Web.DynamicData.DynamicFilter> controls (which are contained in the <xref:System.Web.DynamicData.QueryableFilterRepeater> control), pass a column value to the <xref:System.Web.UI.WebControls.QueryExtender> control.

2. The <xref:System.Web.UI.WebControls.QueryExtender> control uses this value to create the query filtering information, which it then passes to the data source control.

3. The data source control passes the query filtering information to the data source provider.

4. The data source provider passes the query to the database.
![Dynamic Data Table Row Filtering Elements](~/add/media/dynamic-autofilter.png)

5. The database returns the filtered table rows.

6. The data source provider sends this data back to the data source control.

7. This control passes the filtered table rows to the data-bound control for display.
1. The <xref:System.Web.DynamicData.DynamicFilter> controls (which are contained in the <xref:System.Web.DynamicData.QueryableFilterRepeater> control), pass a column value to the <xref:System.Web.UI.WebControls.QueryExtender> control.
2. The <xref:System.Web.UI.WebControls.QueryExtender> control uses this value to create the query filtering information, which it then passes to the data source control.
3. The data source control passes the query filtering information to the data source provider.
4. The data source provider passes the query to the database.
5. The database returns the filtered table rows.
6. The data source provider sends this data back to the data source control.
7. This control passes the filtered table rows to the data-bound control for display.

<a name="DeclarativeSyntax"></a>
## Declarative Syntax

```
```xml
<asp:QueryableFilterRepeater
    ID="string"
    DynamicFilterContainerId="string"
    EnableViewState="True|False"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnPreRender="PreRender event handler"
    OnUnload="Unload event handler"
    Visible="true"
    runat="server" />
ID="string"
DynamicFilterContainerId="string"
EnableViewState="True|False"
OnDataBinding="DataBinding event handler"
OnDisposed="Disposed event handler"
OnInit="Init event handler"
OnLoad="Load event handler"
OnPreRender="PreRender event handler"
OnUnload="Unload event handler"
Visible="true"
runat="server" />
```



## Examples
A Visual Studio project with source code is available at this location: [Scaffolding Dynamic Data](https://go.microsoft.com/fwlink/?LinkId=168914).

The following example shows how to use the <xref:System.Web.DynamicData.QueryableFilterRepeater> control to generate the UI for table row filtering. The repeater's item template contains a <xref:System.Web.DynamicData.DynamicFilter> control that creates the UI for each supported column type.

The example requires the following:

- A Dynamic Data Web site or a Dynamic Data Web application. For more information, see `Walkthrough: Creating a New Dynamic Data Web Site using Scaffolding`.
The example requires a Dynamic Data Web site or a Dynamic Data Web application. For more information, see `Walkthrough: Creating a New Dynamic Data Web Site using Scaffolding`.

:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.web.dynamicdata.queryablefilterrepeater/cs/queryablefilterrepeater.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.web.dynamicdata.queryablefilterrepeater/vb/queryablefilterrepeater.aspx" id="Snippet1":::
Expand Down
Loading