2012-07-31 55 views
2

我無法找到關於此主題的任何示例。我嘗試寫一些代碼,但它發佈null模型。如何將DevEx文本框用作文本框?

@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" /> 
} 

有沒有關於這個話題的例子。我想使用devEx元件html.helper與「爲」

由於

回答

2

有必要使用DevExpressEditorsBinder在[HttpPost]控制器操作,並設置TextBox.Name屬性=模型字段/屬性。

+1

你應該爲devEx工作:) – 2012-07-31 20:45:19

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