Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 23, 2013 11:30 AM by shivdilse
Jan 22, 2013 02:06 PM|LINK
Hi, I have two strongly typed partial views of 2 Models for Create. both the forms are caling the same action. hence, i want the parameter to be dynamic so that i can cast it based on the type i am passing.
public ActionResult RegisterChannelPartner(dynamic channelPartner, string type)
channelPartner; // i would like to cast this dynamic object to a Model type before saving to database.
string encodedPassword = Utilities.EncodePassword(channelPartner.Password);
channelPartner.Password = encodedPassword;
var stakeHolder = new Stakeholder();
stakeHolder.FirstName = channelPartner.FirstName;
stakeHolder.LastName = channelPartner.LastName;
Jan 22, 2013 02:23 PM|LINK
. both the forms are caling the same action. hence, i want the parameter to be dynamic
It is not a reason. Make 2 separate actions.
However, if you want this, you can put channelPartner as object and make a custom ModelBinder
Jan 23, 2013 11:30 AM|LINK
Thank you , It was very helpful :)