Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 需要一个';RaiseEvent';发起一项活动的声明_Asp.net_Vb.net_Raiseevent - Fatal编程技术网

Asp.net 需要一个';RaiseEvent';发起一项活动的声明

Asp.net 需要一个';RaiseEvent';发起一项活动的声明,asp.net,vb.net,raiseevent,Asp.net,Vb.net,Raiseevent,我在网站上有一个页面,在文本框中显示客户的详细信息 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not page.IsPostBack Then Dim dh As New Datahandler Dim CI As ClientInfomation = dh.GETClientInfomationWith

我在网站上有一个页面,在文本框中显示客户的详细信息

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not page.IsPostBack Then  
        Dim dh As New Datahandler
        Dim CI As ClientInfomation = dh.GETClientInfomationWithClientID(Session("ClientID"))

            txtClientID.Text = Session("ClientID")
            txtCompany.Text = CI.Company
            txtEmail.Text = CI.Email
            txtPassword.text = CI.Password
            dtSubcriptionEndDate.Text = CI.SubscriptionEndDate
            txtContactName.Text = CI.ContactName
            txtTelephoneNum.Text = CI.Telephone.ToString()
    End If
上述代码起作用,该代码从GetClientInformationWithClientId(会话(“ClientID”)中的数据库获取客户端数据,并将数据加载到类中,然后从类I将数据加载到文本框中

我的问题就从这里开始。用户现在将在文本框中更改其详细信息,并单击“保存更改”按钮调用butSaveChanges\u click事件

 Protected Sub butSaveChanges_Click(sender As Object, e As EventArgs) Handles butSaveChanges.Click
    Dim dh As New Datahandler
    Dim CI As New ClientInfomation With {.ClientID = txtClientID.Text,
        .Company = txtCompany.Text,
        .ContactName = txtContactName.Text,
        .Email = txtEmail.Text,
        .Password = txtPassword.Text,
        .SubscriptionEndDate = dtSubcriptionEndDate.Text,
        .Telephone = txtTelephoneNum.Text}
    If dh.SaveUserProfileChanegs(CI) = True Then
        ClientScript.RegisterStartupScript(Me.[GetType](), "alert", "alert('Changes has been saved')", True)
    Else
        ClientScript.RegisterStartupScript(Me.[GetType](), "alert", "alert('Changes could not be saved')", True)
    End If
End Sub
我只想将更改后的文本值加载到类中,并在SaveUserProfileChanegs(CI)函数中加载该类,该函数更新数据库中的新值


调用butSaveChanges\u Click事件时,我得到一个“(1):错误BC32022:“Public event Click As EventHandler”是一个事件,无法直接调用。请使用“RaiseEvent”语句引发事件。“

我在此处未看到任何可能导致此问题的内容,错误是否来自SaveUserProfilechanges方法内部?我仍然不确定是什么错误,但它现在可以工作了。谢谢Esko