Guest User

Guest User

  • Tech Writer
  • 103
  • 13.3k

Face Null Value from Model

May 26 2021 4:54 AM
This is my code I have face a Issue null value 
 
public class NotificationMenuViewComponent : ViewComponent
{
public IViewComponentResult Invoke(NotificationMenuDataModel notificationMenuDataModel)
{
var vm = new Notification();--Here Null Value Render but i have set value in input box.
if (vm.Title != null)
{
try
{
vm.Title = notificationMenuDataModel.Title;
vm.Message = notificationMenuDataModel.Message;
}
catch (Exception ex)
{
}
}
 

Answers (3)