hi,all: I have several classes, and each class has many Session-sentences, as the following: string a = Session["a"]; I use
try{
string a = Session["a"];
}
catch(NullHandleException e){
}
to protect them. However. too many Sessions-sentences are there, so is there a simple way to go ? Could i declare a exception in
the head of class that will do throughout this class ? thanks your replies. Andrew.D
serior
Member
175 Points
35 Posts
Question about exception.
Dec 11, 2003 11:12 AM|LINK
try{ string a = Session["a"]; } catch(NullHandleException e){ }to protect them. However. too many Sessions-sentences are there, so is there a simple way to go ? Could i declare a exception in the head of class that will do throughout this class ? thanks your replies. Andrew.DMorritt
Member
220 Points
44 Posts
Re: Question about exception.
Dec 11, 2003 03:36 PM|LINK
if(Session["a"] != null) ... else ...