Well, this is a very difficult task for me. We take our existing ASP.NET website and convert (reverse engineer only PL) to MVC. Our site is very complex. But the tricky part is converting existing user controls to MVC equivilant. Custom controls (I'm not talking about custom controls) is, of course, a class that inherits from System.Web.UI.Control and uses this object everywhere. For example, we have some properties at the top of this existing custom class, for example:
Dictionary<int, Control> configControls;
DropDownList kControl;
CheckBox confirmBox;
These are all variables of the type of Web controls in classic ASP.NET.
So, I thought, maybe what I could do (without creating whole new user controls from scratch) using the HtmlHelper object. So I tried this:
(first include the using statement containing System.Web.MVC.Html at the top of my new custom class in our new web project)
private helper HtmlHelper; Dictionary configControls; helper.DropDownList
but it does not work. Guess I can't use this object this way? I decided that I could use HtmlHelper in the dictionary, and then make variable types outside the helper. but these are just extension methods, not objects
, - "", , , ASP.NET. , MVC obviusly ( ), MVC ?
, , , ( ) HtmlHelper. :
( using, System.Web.MVC.Html, -)
private HtmlHelper helper;
Dictionary configControls;
helper.DropDownList
. , . , , , HtmlHelper, . , , intellisense , "". :?
private HtmlHelper htmlHelper = new HtmlHelper();
ViewContext IViewDataContainer . , ( ), HMTL , Extension, , , HtmlHelper , .
, ""? , ? , HtmlHelper, ? , HtmlHelper , . , .
, , .