Hi i am having following error while rendering the page.
The model item passed into the dictionary is of type 'XXX.Models.MWRCustomerModel', but this dictionary requires a model item of type 'XXX.Controllers.AdminCustSignUpModel'.
My C# code is
public ActionResult signUpTravelAdvantageVip(AdminCustSignUpModel AdminCustSignModel)
{
int number;
string RefferedId = "";
string sponsorUserName = AdminCustSignModel.SpoName;
var fullCountryName = db.MWRAutoStates.Where(x => x.Country == AdminCustSignModel.CountryShortCode).FirstOrDefault();
string incomingCountry = fullCountryName.FullCountryName.ToString();
ViewBag.Promoter = sponsorUserName;
var sponsor = db.GetUserInfo(sponsorUserName).SingleOrDefault();
ViewBag.SponsorFirstName = sponsor.FName;
ViewBag.SponsorLastName = sponsor.LName;
MWRCustomerModel model = new MWRCustomerModel();
if (AdminCustSignModel.CountrySC == "US")
{
model.Sponsor = sponsorUserName;
}
else {
model.Sponsor = sponsorUserName;
model.EuroCustomer = true;
}
model.BillingCountry = AdminCustSignModel.CountrySC;
return View(model);
}
And my view is
@model WarrantyRewards.Models.MWRCustomerModel
@{
ViewBag.Title = "signUpTraAdv";
}
<h2>signUpTraAdv</h2>
I have searched and most of the answer related to "sending a list from back end but in the view using the model for a single object" or "sending one model and using different model at view page". But for me, i am sending single object using a model and using the same model at view. still getting the error.