How to pass part's of a main view's model to partial view?

I'd really recommend re-writing your question so it's clearer However, after struggling with trying to decipher what you mean, I think the problem is that you are sometimes passing schoolAddress as the model and then still expecting the model to have a property of schoolAddress If you do % Html. RenderPartial("addressPartialView", Model. SchoolAddress);% Then the Model in addressPartialView won't have a schoolAddress property, it will be an instance of schoolAddress Of course, if this is well off base, then I'd strongly suggest rewording the original question.

I'd really recommend re-writing your question so it's clearer. However, after struggling with trying to decipher what you mean, I think the problem is that you are sometimes passing schoolAddress as the model and then still expecting the model to have a property of schoolAddress. If you do Then the Model in addressPartialView won't have a schoolAddress property, it will be an instance of schoolAddress.

Of course, if this is well off base, then I'd strongly suggest rewording the original question.

Thanks, sure you get my problem, I really want to send the instance of Model. SchoolAddress object to the partial view. But the problem is Model.

SchoolAddress is null. – helen Oct 19 '10 at 16:26.

And I have student,teacher and other objects that has address with addressId field, when I create the school object, since school object has addressID, I have to create both the address object and school object by making partial view for address object,so that I will not repeat the address fields for all objects that require address. So the school create view will have SchoolViewModel,to accept both object fields.so the Create View is strongly typed view of SchoolViewModel object. And for address create I make strongly typed of partial view with Model.

The problem is Model. SchoolAddress is null. Like but when the address partial view is strongly typed of SchoolViewModel object I can get the value of schoolAddress.

Please ,please would you give me some idea about this, or how can I proceed with other solutions?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions