jquery - Best method to create dynamic Html Controls In MVC -


i have requirement create dynamic html controls , display in view using mvc in .net , need basic validation i.e - if textbox should not empty , if checkbox , validate checkbox checked or not. same time after successfull validation need save in db.

would please tell me approach best achieve this? should not affect preformance.i have list of options in mind 1. using htmlhelperclass,string builder,tag builder. 2. jquery

i dont know option easy , best achieved.

htmlhelper classes of great help. if need implement basic validations required field or regex can rely on validation attributes mvc provides , use model e.g

[required] public string firstname {get; set;} 

you can write own custom attributes , use on model classes

this of great help

a rough sketch dynamic ui

write model class bound db (this contain details of ui controls type,name,attributes etc.). when default controller action hit first time, initialize model , pass on corresponding view, bound model. pretty simple then, can read model values in view , accordingly place ui elements using htmlhelper methods


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -