
251 Cal.App.2d 913 (1967)
EUGENE L. PYLE, Plaintiff and Appellant,
v.
RALPH W. SHIPMAN et al., Defendants and Respondents.
Civ. No. 24200. 
California Court of Appeals. First Dist., Div. Four.  
June 21, 1967.
 David A. Sanders, David R. Glickman and Glickman & Nicholas for Plaintiff and Appellant.
 Title, Tannenbaum & Kaplan and Benjamin L. Kaplan for Defendants and Respondents.
 DEVINE, P. J.
 Appellant brought this action to recover $9,000 as the balance alleged to be due from respondents  [fn. 1] on an agreement of sale of 1,100 shares of stock of Gene-Roger Corporation. This was the entire number of shares which appellant had planned would be issued, and issued to him alone. Appellant represented, in the written agreement of sale with respondents dated December 20, 1962, that an application for permit to issue the shares had been filed and that he *915 would transfer the shares to respondents on issuance, and he agreed to bring about the resignation of the officers and directors of the company. Respondents paid $2,000 on account of the agreed price of $11,000. The sole asset of the corporation was a coffee shop. As originally written, the agreement provided that possession of the corporation's leased premises and assets would be delivered within 48 hours after permit to issue the securities had been obtained. But a handwritten change was made to provide that possession would be delivered on January 1, 1963.
 Appellant's application to the Commissioner of Corporations to issue 1,100 shares, which had been filed on December 24, 1962, was ordered abandoned on February 5, 1963, by reason of failure to file requested information. But the application was renewed on February 15, 1963, accompanied by a balance sheet and profit and loss statement in which there appears, as one item among the liabilities, a loan of $11,000 payable to Eugene Pyle for stock purchases. On March 1, 1963, a permit was granted to issue 1,100 shares to Eugene L. Pyle in consideration of cancellation of the corporation's indebtedness to Pyle in the amount of $11,000.
 Possession of the premises was transferred on January 1, 1963. On January 6, 1963, fire occurred at the coffee shop. On January 7, 1963, respondents gave notice of rescission of the contract, based on asserted fraudulent concealment of defective condition of the premises. This alleged fraud is set up as an affirmative defense to the present action.
 But the sole defense upon which the court acted is that the contract is in violation of the Corporate Securities Act and is therefore void and unenforceable. The court sustained this defense, rendered judgment against appellant and also denied relief to respondents on a counterclaim for the $2,000 down payment plus certain expenses, on the proposition that respondents are in pari delicto. Respondents have not cross-appealed.
 The Trial and the Judgment
 At the commencement of the trial, testimony was taken of two witnesses, experts on fires, as to the probable cause of the fire (whether chargeable to appellant or to respondents). This was done for convenience of the witnesses, for at least one of them had to leave the county shortly. It was agreed that their testimony might become moot, depending on the court's ruling on the issue of illegality of the contract. Judgment *916 in the form of judgment on the pleadings was rendered. [1] Judgment on the pleadings is not to be based on anything dehors the pleadings. (Elmore v. Tingley, 78 Cal.App. 460 [248 P. 706]; 2 Chadbourn, Grossman & Van Alstyne,  1423, pp. 535-536.) [2] The taking of the testimony of the experts on the contingent basis on which it was admitted would not affect the propriety of the judgment even though evidence was not as it probably should have been, formally stricken. [3] Judgment on the pleadings, however, was improper. Evidence essential to the decision was taken in the form of various documents from the office of the Commissioner of Corporations. Conclusions had to be drawn by the judge, even though they were apparent from the documents, such as the court's determination that the corporation was appellant's alter ego. [4] But the form of the judgment and the fact that no findings or conclusions of law were made (at least in the usual form) is of no moment if the judgment is correct in substance and if appellant had a fair hearing. Appellant's counsel indicated that he was satisfied, as to form, with a minute order. This order, so far as relevant to the appeal, simply states that the agreement was "void for being in violation of the Corporate Securities Act."
 Question of the Validity of the Contract
 The applicable statutes are Corporations Code section 26100, which reads in part: "Every security of its own issue sold or issued by any company without a permit of the commissioner then in effect authorizing the issuance or sale of the security is void"; and section 25003, which defines "Company" to include "Individuals selling, offering for sale, negotiating for the sale of, or taking subscriptions for, any security of their own issue." There is, however, an exemption, by section 25152, for sales "when (a) made by or on behalf of a vendor not the issuer or underwriter thereof who, being a bona fide owner of the securities, disposes of his own property for his own account, and (b) the sale is not made, directly or indirectly, for the benefit of the issuer or an underwriter of the security, or for the direct or indirect promotion of any scheme or enterprise with the intent of violating or evading any provision of the Corporate Securities Act." If, therefore, appellant as vendor were not the issuer of the securities but a bona fide owner of them, and if the sale were not made directly or indirectly for the benefit of the issuer, the law would not be violated.
 [5, 6] We conclude that appellant was the issuer; that he *917 was not a bona fide owner of the securities; and that the sale was made for the benefit of the corporation as well as for that of appellant. Appellant was the alter ego of the corporation. He undertook to sell personally the whole number of shares which were to be issued. He agreed to effect the resignation of the officers and directors of the company.
 Although the contract was, as appellant argues, one for the sale of a business in which he had invested his own time and service, and which respondents as purchasers intended to pay for by their efforts in the business, these personal elements do not cancel the fact that the corporation was to profit or to be advanced by the sale. The contract expressly provides that the purchase price is to be applied first to the discharge of the corporation's liabilities. The transaction is within the rule of illegality of contract declared in Bellerue v. Business Files Institute, Inc., 61 Cal.2d 488 [39 Cal.Rptr. 201, 393 P.2d 401]; Conrad v. Superior Court, 209 Cal.App.2d 143 [25 Cal.Rptr. 670]; People v. Mills, 148 Cal.App.2d 392, 406 [306 P.2d 1005]; Smith v. Randall, 51 Cal.App.2d 195, 197- 198 [124 P.2d 334]; 2 Ballantine & Sterling, California Corporation Laws (4th ed.)  459.01, p. 909.
 [7] The fact that there was full participation by respondents in the making of the illegal agreement is of no assistance to appellant in his pursuit of the purchase price. In Black Point Aggregates, Inc. v. Niles Sand & Gravel Co., 188 Cal.App.2d 375, 381 [10 Cal.Rptr. 761], it appears that counsel for the defendant purchaser was the draftsman of the agreement, but this did not prevent his client's defending on the ground of illegality. Respondents' participation has prevented their recovery of the $2,000 down payment. The court has left the parties in the condition in which it found them.
 [8] Appellant's point that the illegality was not properly pleaded because the sections of the Corporations Code were not identified is of no importance. The issue was raised in the answer, respondents' pretrial statement, and the pretrial conference order. The court could have raised the issue on its own motion. (Tevis v. Blanchard, 122 Cal.App.2d 731 [266 P.2d 85].)
 The judgment is affirmed.
 Rattigan, J., and Christian, J., concurred.
NOTES
[fn. 1]  1. By respondents we mean the Shipmans. Defendant Tannenbaum was an alleged trustee only.
