Casey, J. (dissenting). The doctrine of estoppel is, in my view, inapplicable in the circumstances presented in this case and, therefore, I respectfully dissent. Inasmuch as the notice requirement is a condition precedent to plaintiff’s right to maintain an action against a municipality, defendant Town of Schodack was under no obligation to assert the requirement as an affirmative defense or prove plaintiff’s noncompliance (see, Cipriano v City of New York, 96 AD2d 817, 818). It was plaintiff’s obligation to plead and prove compliance with the relevant condition precedent and such compliance is part of *633plaintiffs substantive cause of action (see, Reaves v City of New York, 177 AD2d 437). Municipal defendants may, however, be estopped from asserting a plaintiffs lack of compliance with a condition precedent if the municipality "acts or comports itself wrongfully or negligently, inducing reliance by a party who is entitled to rely and who changes his position to his detriment or prejudice” (Bender v New York City Health & Hosps. Corp., 38 NY2d 662, 668). Assuming that plaintiff could justifiably rely on the Town’s assertion of Town Law § 65-a as an affirmative defense to conclude that no other written notice requirement was applicable, plaintiff did not change his position to his detriment or prejudice. It is undisputed that the Town did not have prior written notice of the condition that allegedly caused the injuries which are the basis for plaintiff’s action. When plaintiff commenced this action, therefore, he had no right to maintain the action because he could not plead and prove compliance with the prior written notice requirement of the local law. Nothing the Town did or did not do after plaintiff commenced the action affected plaintiffs ability to establish such compliance, which, as previously noted, is part of plaintiff’s substantive cause of action.*
When the parties to an action proceed under a mistaken theory as to the type of notice required as a condition precedent, the relevant consideration is not the doctrine of estoppel, but instead the question is whether the parties have consented, formally or by their conduct, to the law to be applied (see, Martin v City of Cohoes, 37 NY2d 162, 165-166). When a case is tried from the very beginning on the theory of actual notice and the jury returns a verdict in favor of the plaintiff after being charged without exception on the theory of actual notice, the municipality has consented to such theory and cannot thereafter assert the existence of a prior written notice requirement (supra). Here, however, the Town raised the prior written notice requirement before the matter was submitted to the jury and, therefore, did not consent to the application of the wrong law.
Plaintiff argues that even if the notice issue is governed by *634the local law and not by Town Law § 65-a, the limited exception to the prior written notice requirement recognized in Blake v City of Albany (63 AD2d 1075, affd 48 NY2d 875) should be applied. The nature of the condition at issue here, however, was such that it would not ordinarily have come to the immediate attention of Town officers unless they had been given actual notice of the condition and, therefore, the prior written notice requirement is applicable (see, Levine v Sharon, 160 AD2d 840, 842).
Supreme Court correctly applied the local law and its order should be affirmed.
At trial, plaintiff claimed that he was deprived of the opportunity to engage in pretrial discovery regarding the validity of the local law, but he has abandoned this claim on appeal, asserting instead a general claim of "unfair surprise”. In any event, plaintiff could not have been prejudiced by the absence of pretrial discovery on the issue of the local law’s validity unless the local law is, in fact, invalid, and there is no evidence in the record to rebut the presumption that the local law is valid (see, Holt v County of Tioga, 56 NY2d 414, 417).