1
I have been looking for a solution for several days but I haven’t found anything useful to me. The problem is this, I have a Conttroller receiving data from View, so far so good, but when I capture this data it only captures through the database method (table User) but wanted it also to save the id value in an integer.
Public actionResult criar ( Usuario usuario, int id)
{
//Faz o que tem que ser feito
// Ele só pega o valor no usuario e no id da como nulll
}
you could better exemplify what you would like, because I didn’t understand.
– Junior Porfirio
So ,in my controller I want to register users ,so far good ,I can but when I sign up again the user with same id it gives error (gives error because can not have two equal id) I am using a logic so that it can receive the id typed by the user passing it to for control by int id ,ai so I can work with the value and manipulate
– Robson Oliveira
When I get user data my int id is saying it contains no value , if I let publc actionResult create (int? id)from as null and do not receive the data from the vi but with public actionResult create ( user) it receives the data
– Robson Oliveira
Try to elaborate on your question. > "...only captures through the database method..." this is a little strange, receive the data from the View in the Controller should not have relation to database, put the code of your View and your Model, so it is easier for staff to help.
– Renan