Well, I am creating this app that allows me to query certain DataBase using ASP.NET MVC 5 with Entity Framework 6.1.3.
Well I came across this situation. I have a DataBase with several connection strings that lets me access different databases.
So I want to create a model where the user can create queries upon those databases. So I came up with an idea to let the user create it as if they were creating a question. For instance: Someone would want to know How many students are studying in the faculty {PLACEHOLDER}? where "How many students are studying in the faculty is a LABEL and {PLACEHOLDER} is a COMBOBOX. The ComboBox will be filled with a list of faculties (A query to a table of a database).
My idea is provide the user with links in order to add as many Labels, TextBoxes, ComboBoxes, etc. for him to create the question. If the user were to create the question above, he will add a Label and then a ComboBox. Then they will fill the information, and with some other function (i am to develop but not the main goal of this question) will satisfy the query.
So, how can I runtime create a link that adds me those (label, textbox, etc.) items in runtime to the view, and then gather that information and save it into the database (for the model in question)?
I´m guessing my link from the view(or viewmodel?) has to pass some information to the controller and then do something and render the view back and let the view know that there is a new "control" (how I named the model for those controls) and render it (or else). How can I achieve that?
Hope I explained myself. If not, please comment and I´ll try to do it better.