0
<%= Html.TextBox("txtWeight", EmployeeInformation.Weight, new { style = "font-family:Verdana;font-size:9px;", @onfocus = "this.value=''", @onmouseover = "jsWeight()", @readonly= (ViewData["flag"].ToString().CompareTo("true")==0 ? true : false) })%>
<%= Html.TextBox("txtWeight", EmployeeInformation.Weight, new { style = "font-family:Verdana;font-size:9px;", @onfocus = "this.value=''", @onmouseover = "jsWeight()", @readonly= ViewData["flag"].ToString()) })%>
上面的代码我米使用显示在文本框的信息,因为你可以看到我米使用的onfocus和的onmouseover让我可以在工具提示中显示数据,我使用@readonly来确保文本框可以或不可以基于条件进行编辑。 但这不适合我。 我已经检查了viewData的值,这是正确的。正如我传递给它。 我已经使用禁用以及试过,但是当我米使用禁用我每次 获得的价值为禁用,当我米使用禁用我的FOUCS事件不工作
如何使用它并填写数据。 我给出的代码包含EmployeeInformation.Weight,这是我想用文本框填充的数据,你可以告诉我如何使用这个 – 2011-06-17 08:22:08