Get / Indexビューで、holidayControllerのPost/Indexメソッドに投稿しています。だから私はUserIDを介して投稿していますが、これを使用してuserNameにアクセスするにはどうすればよいですか?
Ivを試しました
public ViewResult Index(int userID, string userName)
{
Person person = new Person();
//this assigns person.Id to the user Id
person.Id = userID;
//i want to assign name of person to the string userName
userName = person.name;
}
これは、person.nameに対してnullにすることはできませんか?