.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Is there a way to handle Dynamic Forms using ViewModel?

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
Hi,I need to create a dynamic form using the already existing DB entries, from 3 different tables. I am trying to do this by inheriting ViewModel class, which is comprised of all the model instances (or List of instances of unknown count) within it. When I inherit the ViewModel in the View Template, the dynamic form gets generated without any issues, and looks fine. The dynamic form is generated based on iterating over the calls for each required model instance in the ViewModel passed to the View.Each call uses a partial view of the instance to generate the form, and hence multiple iterations create multiple instances of the form. <% foreach (Option item in Model.Options) { %> <%: Html.EditorFor( model => item )%> <% } %> However, when I try to submit the form, the postback does not include the ViewModel object, but rather only the first model instance used in the form.Any suggestions or help would be great!!

View Complete Post

More Related Resource Links

MVC3: Define Dynamic ViewModel property inside Action Filter



How can I define a Dynamic ViewModel property in MVC 3 inside an action filter?

I am looking to have something like but inside the ActionFilter and not in the controller:

ViewModel.Title = "Home";

Thank You,


Multiple forms on the same page MVC2: how to handle (including validation from model)



It should be simple; although I'm having a hard time to figure out the best way to do it. I've MVC2 pages with multiple forms on the same page having different functionalities.

What's the best way to handle this; including the MVC2 way of validation from the model?


Simple Way To Have Dynamic Forms?

Is there a simple way to have dynamic forms? I mean depending on X, show a form with X properties? Right now Im forced to create a model for each form I'm going to show. But I would like it to be optional and ofcorse have the Html.Summaryvalidator work.

I need a dynamic connection string for my windows forms application.


Hello folks


I am brand new to forms applications and visual studio 2008 I am building a forms application to connect to a 3rd party's sdf file. There is no password or username required to connect however the 3rd party app installs the sdf in the users folder for me I am on windows 7 but I have clients on xp.


I went to add a data connection and chose sql ce file and browsed out to my location and it connects and works. But I need this connection string to be for whoever is logged into there laptops or computers no matter the operating system version xp,vista,7.


Data Source=C:\User\username\AppData\Roaming\PS\GES\surve.sdf


Can someone tell me how to do that. Also please explain in words a new borne could understand cause like I said I am new to this.


Thank you


Custom SharePoint forms with some dynamic behaviour


Hello all,

I have this challenge: I need to create custom SharePoint forms with some dynamic behaviour, without programming(no Javascript, C#, ...)  Background: this form would be used to report expenses and the number of invoices is variable.

We're limiting the options for the solution, because we currently lack the programming skills to develop and maintain the code.  So we wanted to test the ability of SPD to solve our particular business situation.  InfoPath is being considered, but is not yet available to us.

I had thought about using a dropdown control (ASP or SharePoint) to select from a list the number of invoices to report.  Then I'd take the selected number as a parameter to conditionally display the necessary fields (date1, amount1, description1, date2, amount2, description2, etc.).

I also need to save the selected number of invoices as part of the expense report, because I can use it in a SPD workflow as part of my process control.

What I have found is the following:

* If I use an ASP dropdown, I can convert the selected number into a parameter and have a "dynamic form" but then I don't have a way to save the number selected in one of the fields (columns) of the expense report.

* If I use a SharePoint dropdown, I can save the number selected in the dropdown, be

Adding Dynamic Maps to Contact Forms with REST Web Services in InfoPath 2010

Learn to use the REST Web service data connection feature in InfoPath 2010 to add a dynamic map to a list form for contacts in SharePoint Server 2010.

Sample: Adding Dynamic Maps to Contact Forms with REST Web Services in InfoPath 2010

Explore the code as you learn to Use the REST Web service data connection feature in InfoPath 2010 to add a dynamic map to a list form for contacts in SharePoint Server 2010.

Handle an event in all Forms

I have many forms(each form contains textbox) ,and for example I want to
handle the textbox keypress event in all forms with one handler...
how can I avoid repeating the code in each page?

How to handle forms in Site.Master?


I have a partial view thats being rendered in my Site.Master file, and it contains a form - im able to submit values and itll throw it to the controller just fine..the problem is when validation fails and i need to go back to the form to display errors

How can i have a form that uses a viewmodel inside Site.Master and still be able to throw it back and post validation errors?

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>

I wont be able to inherit using <MyViewModel> here...i dont think


Sample: Adding Dynamic Maps to Contact Forms with REST Web Services in InfoPath 2010

Explore the code as you learn to Use the REST Web service data connection feature in InfoPath 2010 to add a dynamic map to a list form for contacts in SharePoint Server 2010.

Dialogs and ViewModel - Using Tasks as a Pattern

The ViewModel/MVVM pattern continues to gain popularity, with a blog post showing up every so often, and with tweets and retweets popping up even more often :-). At the same time, there are some interesting topics beyond the core pattern that continue to fuel experimentation. A big one amongst those is how should applications use dialogs when using the view model pattern.

The crux of the problem is the desire to keep the view model independent of UI concerns, and ensure it can be tested in a standalone manner, but that often comes to odds when you want the view model to launch a dialog, and/or do some work after the dialog is closed.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Dynamic Data Templates in GridView ASP.NET 3.5

At a high level, Dynamic Data Templates can be seen as a system to very quickly build up a User Interface linked with the relevant data model, immediately enabling you to perform CRUD operations (Create, Read, Update, Delete) on the database using the specified data source. They provide a powerful method for building up these kinds of applications, and I'm going to focus on an overview of what Dynamic Data Templates actually are, and a few ways of customizing them to suit industry needs.

A Generic Dialog ViewModel

I worked on a wpf viewmodel for dialogs, because it seemed strange to me that you needed for instance windows forms dialogs to open or save files in wpf. So I set about creating my own wpf dialogs. After creating the dialog viewmodels there still remained a small issue with the library and also I didn't have much time to write an article about it. I however published the library containing the viewmodels for dialogs with another article on my blog

Routing for Web Forms in ASP.NET 4.0

posted a prototype demonstrating how one could use Routing within Web Forms. This is something you can do today with ASP.NET 3.5 SP1, because of the work we did to separate Routing from ASP.NET MVC. I would have liked to include Web Form Routing as part of the Routing feature when we were working on SP1, but we didn't have the time to do so in a robust manner before SP1 was locked down.

ASP.NET 4.0 Dynamic Data and Many to Many Entity Framework Entities

I did not play much with Dynamic Data controls in VS2008 and just made a cool discovery in VS2010 Beta 2. This may not even be new, but as I'm sitting 30,000+ feet over the Atlantic ocean, I don't have access to VS2008 at the moment to check.

Dynamic Systems Development Model (DSDM) Methodology

The Dynamic Systems Development Model was developed in the U.K. in the mid-1990s. It is the evolution of rapid application development (RAD) practices. DSDM boasts the best-supported training and documentation of any of the agile software development techniques, at least in Europe. DSDM favors the philosophy that nothing is built perfectly the first time and looks to software development as an exploratory endeavor.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend