Solved

MVC httppost question

Posted on 2013-02-06
1
196 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 74

Accepted Solution

by:
käµfm³d   👽 earned 265 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now