ASP.net - Safe method to check session is null

Robust application has to utilize Proper method to check the session veribles.Following  method is one of the best approch.

Assume  Session["selmachine_id"] hold string value

 string sessionMac = Session["selmachine_id"] as string;

                if (!string.IsNullOrEmpty(sessonTestId))
                {
                    //Valid Action
                 }


Comments

Popular posts from this blog

ENOENT: no such file or directory, rename : node_modules/async

react-quill Integrate quill-image-resize-module