Using Model with none MVC application
I'm trying to use a Model with my Asp.net page. But im not using MVC. I get an error when trying to inherit the model from a customcontrol. The error is
ViewModel: interface开发者_如何学Python name expected.
public partial class CustomControl : UserControl, ViewModel
You cant do multiple inheritance in C#. UserControl
and ViewModel
are both classes and you are only able to inherit from a single class.
You can however implement as many interfaces as you like.
精彩评论