Rameshwar Trivedi
Rameshwar Trivedi

Reputation: 424

MVC 4 how to create dynamic controls

I am using c# MVC 4 and I would like to create Multiple user controls and fill data dynamically.

Eg: I have a history filling form and in it i have to display multiple question having options control which can be radio button or check box also have a text-area with every question.So I do not know the field names and its control types prior to visiting this page, it gets the data and control types from a sql table with question:

field 1: Text-Label

field 2: DropdownList (values: 1,2,3,4,5) or radio button or check-box or text-box

field 3: textarea

How do I achieve this?

Upvotes: 1

Views: 887

Answers (1)

TGH
TGH

Reputation: 39258

To create "user controls" in MVC you should look into creating partials. It can serve as reusable components.

Upvotes: 2

Related Questions