User-1355965324 posted
I am calling the the following javascript in my chtml file. I want to call the function ShowResultModalPopup and ShowErrorModalPopup only if the ViewBag.Result and ViewBag.Error is not empty
So I would like to change as follows
If @ViewBag.Result <> null
{
ShowResultModalPopup('@ViewBag.Result');
}
If @ViewBag.Error<> null
{
ShowErrorModalPopup('@ViewBag.Error');
}
How can I give the if condition to check empty or not. Please help
<script type="text/javascript">
$(document).ready(function () {
KeyHandler();
ShowResultModalPopup('@ViewBag.Result');
ShowErrorModalPopup('@ViewBag.Error');
});
</script>