I have 3 textboxes in three different tab control and i want to generate textbox id like textbox plus concatenate the tab number
for(int i=0;i<3;i++)
{
<%: Html.TextBoxFor(e=>e.vcr_LinkName + i)%>
}
its not working but when i change it to
for(int i=0;i<3;i++)
{
<%: Html.TextBox("vcr_LinkName" + i)%>
}
it works fine. but i want to use textboxfor instead of textbox
You can’t really use textboxfor in this way as you don’t have a property on your model that you want to bind it to. You do, however, have a few other options.
You could have a list of strings on your model and do something like this:
You could build your own helper like this:
And use it like this: