or
//Select List of all cars
public
IEnumerable<System.Web.Mvc.SelectListItem> AllCars
{
get
{
if
(Cars !=
null
)
{
var _sacts = Cars.Select(f =>
new
System.Web.Mvc.SelectListItem
{
Value = f.code,
Text = f.description
});
return
_sacts;
}
else
return
null
;
}
}
public
IEnumerable<CarTypes> Cars {
get
;
set
; }
//Select List of previous saved cars
public
IEnumerable<System.Web.Mvc.SelectListItem> SelectedCars
{
get
{
if
(SelectedCarsValues !=
null
)
{
var _sacts = SelectedCarsValues.Select(f =>
new
System.Web.Mvc.SelectListItem
{
Value = f.code,
Text = f.description
});
return
_sacts;
}
else
return
null
;
}
}
public
IEnumerable<CarTypes> SelectedCarsValues {
get
;
set
; }
@(Html.Kendo().MultiSelectFor(m => m.SelectedCars)
.BindTo(Model.AllCars)
.DataTextField("Text")
.DataValueField("Value")
)
<
script
type
=
"text/x-kendo-tmpl"
id
=
"CarsTemplate"
>
${Text}
</
script
>
@(Html.Kendo().ListView(Model.SelectedCars)
.Name("Cars")
.TagName("p")
.ClientTemplateId("CarsTemplate")
.BindTo(Model.SelectedCars)
)
public IEnumerable<
string
> SelectedCars
{
get
{
if (SelectedCarsValues != null)
{
return SelectedCarsValues.Select(a => a.code);
}
else return null;
}
}
[RegularExpression(@
"([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-zA-Z0-9]{1}[a-zA-Z0-9\-]{0,62}[a-zA-Z0-9]{1})|[a-zA-Z])\.)+[a-zA-Z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)"
, ErrorMessage =
"Not a valid email"
)]
[DataType(DataType.EmailAddress)]
public
string
Email {
get
;
set
; }
<
input
type
=
"text"
value
=
""
name
=
"Email"
id
=
"Email"
data-val-required
=
"Das Feld wird benötigt."
data-val-regex-pattern
=
"([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-zA-Z0-9]{1}[a-zA-Z0-9\-]{0,62}[a-zA-Z0-9]{1})|[a-zA-Z])\.)+[a-zA-Z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)"
data-val-regex
=
"Not a valid email"
data-val
=
"true"
class
=
"text-box single-line"
data-bind
=
"value:Email"
>
<
input
type
=
"text"
value
=
""
name
=
"Email"
id
=
"Email"
data-val-required
=
"Das Feld wird benötigt."
data-val-regex-pattern
=
"([w!#$%&'*+-/=?^`{|}~]+.)*[w!#$%&'*+-/=?^`{|}~]+@((((([a-zA-Z0-9]{1}[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]{1})|[a-zA-Z]).)+[a-zA-Z]{2,6})|(d{1,3}.){3}d{1,3}(:d{1,5})?)"
data-val-regex
=
"Not a valid email"
data-val
=
"true"
class
=
"text-box single-line"
data-bind
=
"value:Email"
>