Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings,

Iám using VS2015 Pro. Creating a MVC project. I have one view with several partial views. Partialview (A) contains input fields; all fields contain values. PartailView (B) contains a button and several fields for displaying results. When I press the button, The filled fields of (A) are being used for several calculations and the results are being displayed in (B). But before I can do the calculations I need to know the values of the fields in PartialView (A). Question:, How can I discover what the values are of the fields of Partialview (A). I used several techniques but Always get the result null.

Any help would be appreciated.
Thanks Peter Bellen, The Netherlands
Posted
Comments
The partial view fields should be bound with a Model Properties. Is it done?

1 solution

Hi,

Your question is you need to ensure that which input values are posted from PartialView (A).

Scenario :
1. You have 3 fields, (InptA, InptB, InptC)
2. First create a class with above property name ( class Name : ParVewA)
3. Now create another class ( which will be the main model for that view), set a property name with PartialA which typeof ParVewA
4. now in your partial view's HTML put fields name like ( PartialA.InptA,PartialA.InptB, PartialA.InptC)

Now when you post data to server your model's property PartialA would set with the values which has been submitted by Partial View (A)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900