c# 4.0 - Dynamic ViewModel Generation in asp.net mvc 3 -


i attempting ambitious on asp.net mvc 3 backed c sharp 4.0 . without further trash talk point .

i have build web application in can make simple forms ( cms type application) .

the usual approach take design form in cshtml , , viewmodel.

the viewmodel takes care of validation rules , error messages etc. have allow user create form .

i sat write down on piece of paper on how go . able generate form , based on user inputs , have reached deadend , how create viewmodel @ runtime ?

for example if in database , konw form called "registration" , has control "textbox" , take string , required

public class registrationviewmodel { [required(errormessage="cant let go buddy")] public string name {get;set;} } 

i wish type views such viewmodels , not sure how dynamically construct c# class based on data have inside database.

i not sure if c# has constructs achieve purpose , new .net platform .

i want know if there approach can generate viewmodels database @ runtime , , type views them .

thanks

well there assemblybuilder class can use runtime types.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -