check if ViewBag property is null or not exists

How to check if ViewBag property is null or not exists?

Hello everyone, I am going to share the code sample for check if ViewBag property is null or not exists in CS HTML(Razor).

The code detail as given blow.

Syntax :

@if (ViewBag.IsExist != null && ViewBag.IsExist == true)
{
   <label> Your password has been reset successfully!</label>
}

ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.