public mustinherit class loginform inherits system.web.ui.usercontrol protected withevents user as system.web.ui.webcontrols.textbox protected withevents pass as system.web.ui.webcontrols.textbox protected withevents button1 as system.web.ui.webcontrols.button #region " web 窗体设计器生成的代码 "
'该调用是 web 窗体设计器所必需的。 <system.diagnostics.debuggerstepthrough()> private sub initializecomponent()
end sub
private sub page_init(byval sender as system.object, byval e as system.eventargs) handles mybase.init 'codegen: 此方法调用是 web 窗体设计器所必需的 '不要使用代码编辑器修改它。 initializecomponent() end sub
#end region
private sub page_load(byval sender as system.object, byval e as system.eventargs) handles mybase.load '在此处放置初始化页的用户代码 end sub public property userid() as [string] get return user.text end get set(byval value as [string]) user.text = value end set end property public property password() as [string] get return pass.text end get set(byval value as [string]) pass.text = value end set end property end class 步骤2:创建该用户控件显示的ui元素。以下代码创建与来自步骤1的代码进行交互的登录窗体。