Inheritance example

This example shows you how to redefine an inherited feature from WEB_PAGE. In this sample, we redefine the feature on_load. When the page is loaded, the feature on_load is called and displays the string "on_load feature called" in a label.

 

<%@ Page Language="Eiffel" Description="Eiffel ASP.NET example" %>

<script runat=server>
inherit
    WEB_PAGE
	redefine
		on_load
	end
</script>

<script runat=server>
feature -- Redefinition
     on_load (e: EVENT_ARGS) is
	    -- redefinition of on_load feature
	do
	    Precursor {WEB_PAGE} (e)
	    lbl_output.set_Text (("on_load feature called.").to_cil)
	end
</script>

<html>
    <body>
     	<asp:Label runat=server id=lbl_output />
    </body>
<html>

 

Here is the output:

 

[run the example]