0
I would like to concatenate the ID I get from @Model in the property string name of the Dropdownlist, because I would like to treat them dynamically.
I try to do @Html.Dropdownlist("Name" + @Model.Id) and it doesn’t work.
How could I do?
0
I would like to concatenate the ID I get from @Model in the property string name of the Dropdownlist, because I would like to treat them dynamically.
I try to do @Html.Dropdownlist("Name" + @Model.Id) and it doesn’t work.
How could I do?
2
Do it in your Model:
public string ConcatenarNome
{
get
{
return string.Format("Nome{1}", Id);
}
}
And then on View:
@Html.DropDownList(@Model.ConcatenarNome)
Browser other questions tagged asp.net-mvc razor
You are not signed in. Login or sign up in order to post.