Submodel in the sameview MVC?What are MVP and MVC and what is the difference?Compile Views in ASP.NET MVCIn MVC, how do I return a string result?What is the difference between MVC and MVVM?MVC pattern on AndroidASP.NET MVC 3 - Add/Remove from Collection Before PostingFile Upload ASP.NET MVC 3.0How should a model be structured in MVC?Build Submodels that point to the same modelHow can I get Model submodel attribute? mvc asp.net
Partial sums of primes
Can the harmonic series explain the origin of the major scale?
Reply ‘no position’ while the job posting is still there (‘HiWi’ position in Germany)
Are Warlocks Arcane or Divine?
What to do when my ideas aren't chosen, when I strongly disagree with the chosen solution?
Stereotypical names
I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?
Adding empty element to declared container without declaring type of element
The most efficient algorithm to find all possible integer pairs which sum to a given integer
Simple image editor tool to draw a simple box/rectangle in an existing image
Lifted its hind leg on or lifted its hind leg towards?
Java - What do constructor type arguments mean when placed *before* the type?
What should I use for Mishna study?
Hostile work environment after whistle-blowing on coworker and our boss. What do I do?
Can I rely on these GitHub repository files?
Should my PhD thesis be submitted under my legal name?
How can I successfully establish a nationwide combat training program for a large country?
Word describing multiple paths to the same abstract outcome
Could solar power be utilized and substitute coal in the 19th century?
Why does this part of the Space Shuttle launch pad seem to be floating in air?
Meta programming: Declare a new struct on the fly
Can a Bard use an arcane focus?
Have I saved too much for retirement so far?
How to prevent YouTube from showing already watched videos?
Submodel in the sameview MVC?
What are MVP and MVC and what is the difference?Compile Views in ASP.NET MVCIn MVC, how do I return a string result?What is the difference between MVC and MVVM?MVC pattern on AndroidASP.NET MVC 3 - Add/Remove from Collection Before PostingFile Upload ASP.NET MVC 3.0How should a model be structured in MVC?Build Submodels that point to the same modelHow can I get Model submodel attribute? mvc asp.net
I have a Model call Customer like this
public class Customer : Person
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "0:yyyy-MM-dd hh:MM:ss")]
[Display(Name = "Create Date")]
public DateTime CreateDate get; set;
public Status Status get; set;
public virtual List<Note> Notes get; set;
Now I would like to include the subModel "Notes" in the same view.
because I would like to open a page with Customer details but also able to Add, edit, read all the notes in the same page.
I try to use
@Html.TextAreaFor(model => model.Notes)
how ever its not possible.
so I create a viewModel
public class CustomerNotesModel
public Customer Customers get; set;
public Note Note get; set;
but this throws me an error when I try to click "details" or the page.
which return a customer to a page type of
argument type 'Model.customers' is not assignable to model type
'viewModels.customerNotesModel' mvc..
sorry, I'm very new to it and i really i did try hell hard to find it out unfortunately there wont be enough time for me.
anyone has any Idear?
as long as im able to ADD a note of the current Customer in the same page is fine. Thanks
asp.net-mvc model-view-controller
add a comment |
I have a Model call Customer like this
public class Customer : Person
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "0:yyyy-MM-dd hh:MM:ss")]
[Display(Name = "Create Date")]
public DateTime CreateDate get; set;
public Status Status get; set;
public virtual List<Note> Notes get; set;
Now I would like to include the subModel "Notes" in the same view.
because I would like to open a page with Customer details but also able to Add, edit, read all the notes in the same page.
I try to use
@Html.TextAreaFor(model => model.Notes)
how ever its not possible.
so I create a viewModel
public class CustomerNotesModel
public Customer Customers get; set;
public Note Note get; set;
but this throws me an error when I try to click "details" or the page.
which return a customer to a page type of
argument type 'Model.customers' is not assignable to model type
'viewModels.customerNotesModel' mvc..
sorry, I'm very new to it and i really i did try hell hard to find it out unfortunately there wont be enough time for me.
anyone has any Idear?
as long as im able to ADD a note of the current Customer in the same page is fine. Thanks
asp.net-mvc model-view-controller
Are you using view model in your view?
– Parvez
Mar 7 at 10:33
please add current code for view and controller here
– Hien Nguyen
Mar 7 at 10:50
add a comment |
I have a Model call Customer like this
public class Customer : Person
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "0:yyyy-MM-dd hh:MM:ss")]
[Display(Name = "Create Date")]
public DateTime CreateDate get; set;
public Status Status get; set;
public virtual List<Note> Notes get; set;
Now I would like to include the subModel "Notes" in the same view.
because I would like to open a page with Customer details but also able to Add, edit, read all the notes in the same page.
I try to use
@Html.TextAreaFor(model => model.Notes)
how ever its not possible.
so I create a viewModel
public class CustomerNotesModel
public Customer Customers get; set;
public Note Note get; set;
but this throws me an error when I try to click "details" or the page.
which return a customer to a page type of
argument type 'Model.customers' is not assignable to model type
'viewModels.customerNotesModel' mvc..
sorry, I'm very new to it and i really i did try hell hard to find it out unfortunately there wont be enough time for me.
anyone has any Idear?
as long as im able to ADD a note of the current Customer in the same page is fine. Thanks
asp.net-mvc model-view-controller
I have a Model call Customer like this
public class Customer : Person
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "0:yyyy-MM-dd hh:MM:ss")]
[Display(Name = "Create Date")]
public DateTime CreateDate get; set;
public Status Status get; set;
public virtual List<Note> Notes get; set;
Now I would like to include the subModel "Notes" in the same view.
because I would like to open a page with Customer details but also able to Add, edit, read all the notes in the same page.
I try to use
@Html.TextAreaFor(model => model.Notes)
how ever its not possible.
so I create a viewModel
public class CustomerNotesModel
public Customer Customers get; set;
public Note Note get; set;
but this throws me an error when I try to click "details" or the page.
which return a customer to a page type of
argument type 'Model.customers' is not assignable to model type
'viewModels.customerNotesModel' mvc..
sorry, I'm very new to it and i really i did try hell hard to find it out unfortunately there wont be enough time for me.
anyone has any Idear?
as long as im able to ADD a note of the current Customer in the same page is fine. Thanks
asp.net-mvc model-view-controller
asp.net-mvc model-view-controller
edited Mar 7 at 10:28
demo
2,38433984
2,38433984
asked Mar 7 at 10:20
kellybazingakellybazinga
2610
2610
Are you using view model in your view?
– Parvez
Mar 7 at 10:33
please add current code for view and controller here
– Hien Nguyen
Mar 7 at 10:50
add a comment |
Are you using view model in your view?
– Parvez
Mar 7 at 10:33
please add current code for view and controller here
– Hien Nguyen
Mar 7 at 10:50
Are you using view model in your view?
– Parvez
Mar 7 at 10:33
Are you using view model in your view?
– Parvez
Mar 7 at 10:33
please add current code for view and controller here
– Hien Nguyen
Mar 7 at 10:50
please add current code for view and controller here
– Hien Nguyen
Mar 7 at 10:50
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041351%2fsubmodel-in-the-sameview-mvc%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041351%2fsubmodel-in-the-sameview-mvc%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you using view model in your view?
– Parvez
Mar 7 at 10:33
please add current code for view and controller here
– Hien Nguyen
Mar 7 at 10:50