0

I created the default scaffold for my models and the edit method doesn't work, because one of the properties can't be null and i don't want to change it, but i have to because the method must have something that is not null. My question is how can i trans parameters from one action that returns a view to another action, and how can i use this line which came with the default scaffold?:

ViewBag.CreatorId = new SelectList(db.Users, "Id", "NickName", plan.CreatorId); 

In other post i saw someone who sent the id of the submit button which is equals to a specific data from the view. Something like that:

<input type="submit" value="Save" class="btn btn-default" id = "@Model.CreatorId" />

Is it possible? And if it is, how to i receive that id in the controller (what type is it)?

The properties are: name, description, level, id and creator id. The level, name and description Obtained by editorfor html helper and the id and creator id should stay the same.

Elad
  • 13
  • 5
  • no , you should be with model banding .or any other . – Nazmul Hasan Apr 23 '16 at 15:17
  • may i see an example? The properties are: name, description, level, id and creator id. The level, name and description Obtained by editorfor html helper and the id and creator id should stay the same. – Elad Apr 23 '16 at 15:25
  • you can do it but . may be you unable to send by submit – Nazmul Hasan Apr 23 '16 at 15:28
  • you can apply flowing approach http://stackoverflow.com/questions/27901175/how-to-get-dropdownlist-selectedvalue-in-controller-in-mvc4 – Nazmul Hasan Apr 23 '16 at 15:29

0 Answers0