Talk:CSharp vs. Oxygene
From The Oxygene Language Wiki
Does Delphi Prism support the creating of single file Web pages? While I would recommend that developers stick to code-behind development, it is still interesting to know if Delphi Prism can be used for single file Web pages.
After some testing, I know the answer. Yes. Here is what you do
1. After placing a Web control, select it. 2. In the Properties window, click the Events toolbar button to display the events page. Double-click the event you want to add. 3. An attribute will be added to the element associated with your Web control in the ASPX file. For example, the following defines a button to which a Click event has been added.
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
4. Now, add your method to the <script> element. You must correctly match the parameter list, and your method must have the name assigned to the event in the Web control tag. The following is an example of what this looks like:
<script runat="server"> procedure Button1_Click(sender: System.Object; e: System.EventArgs); begin Label1.Text := TextBox1.Text; end; </script>
There is, however, one point that I overlooked. The reason that single file Web pages was not acceptable in RAD Studio is that you did not have permission to distribute the Delphi compiler. I do not know whether it will be acceptable to deploy the Delphi Prism compiler.