3
Answers

Face Null Value from Model

Guest User

Guest User

3y
441
1
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)