如何使用DevEx文本框作为文本框?

时间:2022-06-08 21:12:11

I cant find any example about this topic. I try to write some code but it post null model.

我找不到任何关于这个话题的例子。我试着写一些代码,但它会生成空模型。

@model DevExpressMvcApplication2.Models.Customers
@{
    ViewBag.Title = "MusteriEkle";
}
@using (Html.BeginForm((string)ViewBag.FormAction, "Home"))
{
<div class="editorContainer">
    @Html.DevExpress().TextBox(
            settings =>
            {
                settings.Name = "textBox1";
                settings.Width = 170;
                settings.Properties.NullText = "Enter your name...";
            }
        ).Bind(Model.customer_name).GetHtml()
</div>
<input type="submit" value="submit" />
}

Is there any example about this topic. I want to use devEx elements as html.helper with "for"

关于这个话题有什么例子吗?我想使用devEx元素作为html。与“助手”

Thanks

谢谢

2 个解决方案

#1


2  

It is necessary to use the DevExpressEditorsBinder in the [HttpPost] Controller Action and set the TextBox.Name property = the model field/property.

有必要在[HttpPost]控制器动作中使用DevExpressEditorsBinder并设置文本框。Name属性=模型字段/属性。

#2


0  

@Html.DevExpress().TextBoxFor(model => model.Code,
settings => {
settings.Name = "txtCode";
settings.Width = 170;
settings.Properties.NullText = "000"; }).GetHtml()

#1


2  

It is necessary to use the DevExpressEditorsBinder in the [HttpPost] Controller Action and set the TextBox.Name property = the model field/property.

有必要在[HttpPost]控制器动作中使用DevExpressEditorsBinder并设置文本框。Name属性=模型字段/属性。

#2


0  

@Html.DevExpress().TextBoxFor(model => model.Code,
settings => {
settings.Name = "txtCode";
settings.Width = 170;
settings.Properties.NullText = "000"; }).GetHtml()