Category / Section
How to assign values through a Model for EJ controls in VB?
2 mins read
Description
You can pass values to your EJ controls from the Model to the View page by setting value in the Model and returning it in the Controller page.
Solution
When you look at RTE for example, you have to render RTE in the View page as shown in the following code example.
View
@Html.EJ().RTEFor(Function(model) model.Description).EnableResize(False).ShowFontOption(True).Width("98%")
You have to set the value for the RTE control as “RTE Value” in the Model page as shown in the following code example.
Model
Public Class RteModel Public Property Description() As String Get Return m_Description End Get Set(value As String) m_Description = value End Set End Property Private m_Description As String = "RTE Value" End Class
Then you have to pass the value in the Controller page as shown in the following code example.
Controller
Public Class RteController Inherits Controller ' GET: Rte Function Index() As ActionResult Return View(New RteModel()) End Function End Class
The sample is attached in the following location:
http://www.syncfusion.com/uploads/user/directTrac/138423/RTEModelVB-143002661.zip