0

I need to create dynamic fields (textbox,combo) based on the entries in an XML file

I will read the ATTRIBUTES XML tag and must create the type of control and add validations to it. Can someone say how to use MVC3 to create dynamic controls, becos i cannot have different class for models as the XML file will change for each screen and i will have one screen which will generate this page for me...

1 Answer 1

2

perhaps you can create your own html helper functions to do that. There are built-in helpers such as html.TextBoxFor(x => x.id). So you might write your own html.RenderFor( () => xmlDocumentBindedToyYourView )

And your controller for example

public ActionResult render()
{
   XMLDocument xdoc ; // do your xml doc reading....
   return View(xdoc);
}
Sign up to request clarification or add additional context in comments.

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.