求助关于BUTTON控件的
编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
编译器错误信息: BC30390: “new1.WebForm1.Private Sub submit_Click(sender As Object, e As System.EventArgs)”是“Private”,因此它在此上下文中无法访问。
源错误:
行 25: </p>
行 26: <p>
行 27: <asp:button ID="submit" OnClick="submit_click" text="submit" Runat="server" />
行 28: </p>
行 29: </form>
怎么我不能用BUTTon空件呀
怎么改呀
<h2>Username:</h2>
<p>
<asp:textbox id="username" Runat="server" Columns="30"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" ErrorMessage="RequiredFieldValidator"
ControlToValidate="username" text="please enter useraname"></asp:requiredfieldvalidator>
</p>
<h2>password:</h2>
<p><asp:textbox id="password" Runat="server" TextMode="Password" Columns="30"></asp:textbox><asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator"
ControlToValidate="password" text="please enter password"></asp:requiredfieldvalidator>
</p>
<p>
<asp:label ID="lbl" Runat="server" />
</p>
<p>
<asp:button ID="submit" OnClick="submit_click" text="submit" Runat="server" />
</p>
点button输入:
Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click
If IsValid Then
lbl.Text = "欢迎"
End If
End Sub
End Class
[此贴子已经被作者于2006-8-13 23:25:24编辑过]