Whenever any district is formed pursuant to this part and its control is vested in the board of supervisors of the county in which the district is situated, the board of supervisors may pass all necessary ordinances for the regulation of the district and provide that the violation of such ordinances constitutes a misdemeanor.