gpt4 book ai didi

vb.net - 编译错误-vb.net 不是成员错误

转载 作者:行者123 更新时间:2023-12-02 11:05:52 25 4
gpt4 key购买 nike

我正在尝试在网页后面编写一些代码以在单击按钮时发送电子邮件。

我有一个文本框

<asp:TextBox ID="txtSecEmail" runat="server" Width="189px" 
ontextchanged="txtSecEmail_TextChanged"></asp:TextBox>

之后我还有一个按钮
<asp:Button ID="btnUploadFiles" runat="server" Text="Upload Files"      
Command="Command"
CommandArgument="CommandArgument"
runat="server" onclick="btnUploadFiles_Click" />

当我尝试加载页面时出现此错误

编译错误
说明:在编译服务此请求所需的资源期间发生错误。请查看以下特定错误详细信息并适当修改您的源代码。

编译器错误消息:BC30456:“txtSecEmail_TextChanged”不是“ASP.datauploaddatafiles_aspx”的成员。
Source Error:


Line 94: <td>
Line 95: &nbsp;&nbsp; EMAIL ADDRESS:
Line 96: <asp:TextBox ID="txtSecEmail" runat="server" Width="189px"
Line 97: ontextchanged="txtSecEmail_TextChanged"></asp:TextBox>
Line 98: </td>

源文件:Y:\Prog\NET\web\ClientCenterNew\datauploaddatafiles.aspx 行:96

我不明白它怎么不是成员(member)?为什么这么说?

最佳答案

它正在代码隐藏 (datauploaddatafiles.aspx.vb) 中寻找 txtSecEmail_TextChanged 方法。将该子例程放在文件后面的代码中并重建。

例子:

Protected Sub txtSecEmail_TextChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles txtSecEmail.TextChanged
'Some Code
End Sub

关于vb.net - 编译错误-vb.net 不是成员错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12305538/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com