请教一个问题textbox.text 在类方法引用问题
运行提示hairclor=tbhair.Text对非共享成员的引用要求对象引用,是什么原因,类方法不能直接引用还是那里出错,请帮帮忙?<HTML>
<HEAD>
<script language="VB" runat="server">
CLASS cx
public hairclor as string
public eyeclor as string
public birthday as date
sub setmyself(Sender As Object, E As EventArgs)
hairclor=tbhair.Text
eyeclor=tbeye.Text
birthday=date(tbbir.Text)
end sub
end class
sub btSubmit_click(Sender As Object, E As EventArgs)
dim week as integer
week=birthday.dayofweek
response.write(hairclor&eyeclor)
end sub
</script>
</HEAD>
<BODY bgcolor="#cccccc">
<font size="5">Sam's Teach Yourself in 21 Days: Day 2, Exercise 1</font><hr>
<p>
<form runat="server" ID="Form1">
hair:
<asp:textbox id="tbhair" runat="server" />
eye:
<asp:textbox id="tbeye" runat="server" />
<asp:button id="btSubmit" Text="Submit" OnClick="btSubmit_Click" runat="server" />
<P>
birthday:
<asp:TextBox id="tbbir" runat="server"></asp:TextBox>
</P>
<P> </P>
<P> </P>
</form>
</BODY>
</HTML>