See the difference in the punitive sections of the codes?
§ 18.2-119. Trespass after having been forbidden to do so; penalties.
If any person without authority of law goes upon or remains upon the lands, buildings or premises of another, or any portion or area thereof, after having been forbidden to do so, either orally or in writing, by the owner, lessee, custodian or other person lawfully in charge thereof, or after having been forbidden to do so by a sign or signs posted by such persons or by the holder of any easement or other right-of-way authorized by the instrument creating such interest to post such signs on such lands, structures, premises or portion or area thereof at a place or places where it or they may be reasonably seen, or if any person, whether he is the owner, tenant or otherwise entitled to the use of such land, building or premises, goes upon, or remains upon such land, building or premises after having been prohibited from doing so by a court of competent jurisdiction by an order issued pursuant to §§ 16.1-253, 16.1-253.1, 16.1-253.4, 16.1-278.2 through 16.1-278.6, 16.1-278.8, 16.1-278.14, 16.1-278.15, 16.1-279.1, 19.2-152.8, 19.2-152.9 or § 19.2-152.10 or an ex parte order issued pursuant to § 20-103, and after having been served with such order, he shall be guilty of a Class 1 misdemeanor. This section shall not be construed to affect in any way the provisions of §§ 18.2-132 through 18.2-136.