Imports System
Imports System.Collections
Imports System.Web.UI
Imports System.Web.UI.WebControls


Public Class BaseClass
Inherits System.Web.UI.Page


'在events.aspx中使用的控件都被声明为同一个id
Protected qty as textbox
Protected price as textbox
Protected amount as textbox


Sub Page_Load(Source As Object, E As EventArgs) 
  '页面加载事件
  '每次页面加载时触发此事件
  
 	response.write("Page Load Event : -->fired  <br>")
 	
  if NOT (isPostBack)
  	'此部分代码只在页面加载时执行一次
  	'检查isPostBack属性确保返回操作不执行以下代码
  	response.write("The not isPostBack construct:--> ensures this does not get fired at reloads")
    end if
  
  
  End Sub
    	
 '此部分代码从evernts.aspx窗体中分离
 
 Sub Calculate(src As Object,e As EventArgs)
         
         Amount.Text = Cstr(cint(qty.text)*cint(price.text))
 End sub   	

End Class
