Solved

MVC httppost question

Posted on 2013-02-06
1
199 Views
Last Modified: 2013-02-21
Hello all.

I have three views i am working with.  Each view is a form that the user fills out the first view called Product.   I have that first view bound to a productmodel class where in that model class i have validation.  once i submit in the productcontroller i have an httppost action wherr i pass the productmodel class in as a param and do a model.isvalid.  if valid i do a return View(Customer) which is a customer view.  My question is i want the customer view to be bound to a customermodel class.  How do i do that is that a redirectaction or something?  Im confused because i may want to also ref model binding of the productmodel as well.
0
Comment
Question by:sbornstein2
1 Comment
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 265 total points
ID: 38859536
My question is i want the customer view to be bound to a customermodel class.
Unless I'm misunderstanding your question, you simply need to declare the model type at the top of your Customer view.

e.g.

@model Customer

@* Some HTML *@

<div>@Model.Name</div>

Open in new window


Remember:  Little "m" is the declaration of the model type; Big "M" is the instance of the model  : )
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Creating a route in asp.net webforms 2 32
Tracing a live website down to the files which support it 2 26
using CK editor in iframes 5 18
asp.net mvc 2 25
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question