ModelMethodContext Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Used to invoke the UpdateModel<TModel>(TModel) or TryUpdateModel<TModel>(TModel) method when the Page object is not directly accessible.
public ref class ModelMethodContext
public class ModelMethodContext
type ModelMethodContext = class
Public Class ModelMethodContext
- Inheritance
-
ModelMethodContext
For example, a custom class can define the methods referred to by the SelectMethod
, UpdateMethod
, DeleteMethod
, and InsertMethod
properties for data binding, and those methods can have a parameter of this type and use it to invoke the UpdateModel method. Alternatively, instead of a method parameter, the Current property can be used within a method to invoke the UpdateModel method.
For a tutorial series on using model binding with Web Forms, see Model Binding and Web Forms.
Model |
Initializes a new instance of the ModelMethodContext class. |
Current |
Gets the ModelMethodContext object that corresponds to the Page object that is in the Current property. |
Model |
Gets the model state. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Try |
Updates the specified model instance using values from the specified value provider. |
Try |
Updates the specified model instance using values from a value provider. |
Update |
Updates the specified model instance using values from the specified value provider. |
Update |
Updates the specified model instance using values from a value provider. |
Product | Versions |
---|---|
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: