将linkvalue文本从model传递到html.actionlink [英] Pass linkvalue text from model to html.actionlink

查看:86
本文介绍了将linkvalue文本从model传递到html.actionlink的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在模型中有文本值。



我喜欢在linktext参数中将模型中的文本传递给html.actionlink。



它抛出一个值不能为空或空。

参数名称:linkTextl错误。



I have text values in the model.

I like to pass the text from model to html.actionlink in the "linktext" parameter.

It throws me a "Value cannot be null or empty.
Parameter name: linkTextl" error.

@foreach (var item in Model)
{
    
       <tr>
        <td>
            @Html.ActionLink(item.Name,"Details")
         
        </td>
      </tr>
        
}





提前致谢。



Thanks in advance.

推荐答案

代码没问题,检查Model是否包含任何数据,如果有数据,则检查item.Name。
The code is OK, check whether Model contains any data if data present then check item.Name.


这篇关于将linkvalue文本从model传递到html.actionlink的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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