MVC3中的Ajax.actionLink问题 [英] Ajax.actionLink problem in MVC3

查看:78
本文介绍了MVC3中的Ajax.actionLink问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我无法将文本字段值设置为ajax.action ID.

这是我的代码:


Hi,

I cant set text field value to ajax.action ID .

This is my code :


@Html.TextBoxFor(m => m.DivisionId)
    @Html.ValidationMessageFor(m => m.DivisionId)
    @Ajax.ActionLink("Find", "Find", "DivisionSetup", new { id = ????? }, new AjaxOptions { UpdateTargetId = "find"})


我需要将


I need to set

@Html.TextBoxFor(m => m.DivisionId)

的值设置为id = ??? ?? .

请帮帮我.

value to id = ????? .

Please help me out.

推荐答案

,当您使用
@Html.TextBoxFor(m => m.DivisionId)


TexBoxFor呈现为


the TexBoxFor render as

<input id="DivisionId" name="DivisionId" type="text" value="" />


TextBoxFor帮助程序使用作为第一个参数传递的lambda表达式来计算输入字段的名称.因此,如果您希望使用某些ID或名称来调用生成的输入字段,只需在视图模型中重命名该属性


The TextBoxFor helper uses the lambda expressions that is passed as first argument to calculate the name of the input field. So if you want the generated input field to be called with some Id or name , simply rename the property in your view model


这篇关于MVC3中的Ajax.actionLink问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆