When lands lying within the corporate limits of towns or cities are owned by a county or agricultural society and used for agricultural fair purposes, the lands and the buildings now or hereafter erected are exempt from the zoning, building, and other ordinances of the town or city; provided, that no license or permit need be obtained from, nor fee paid to, the town or city in connection with the use of the lands. For the purposes of this section, “agricultural fair purposes” includes the management of property as provided in section 38.01, paragraph (a).