0

I have an input like ["abc","def","ghi"]. I have to split this into "abc" "def" "ghi" in view of C# MVC. And also i have to display each string value into separate text box of same row.

I have tried like

@Html.TextBoxFor(m => (String.Join(",", m.editPeriodicTask.args))[1], new { @id = "args", @class = "form-control-list" })

but I am not getting the right solution. Can anyone please suggest on this.

Thanks in Advance

1
  • If the 2nd list having ["xxx","yyy"] values means, The third text box will be empty Commented Feb 12, 2016 at 4:30

2 Answers 2

0

in js u can split array using

var s= arrayname.split(",");
Sign up to request clarification or add additional context in comments.

Comments

0

This is not exactly what you are looking for, but it seems using loops is the most common way to achieve it.

Asp.net razor textbox array for list items

This link might be helpful, in case of three textboxes, you can loop for 3 times instead of the size of the collection.

Hope it helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.