Home » .NET 4.0 » Record Update Confirmation Message

Record Update Confirmation Message

DataSource connection string

<asp:sqldatasource ID="MySQLDS" runat="server" 
ConnectionString="< %$ ConnectionStrings:MyConnString %>" 
UpdateCommand="UPDATE [MyTablel] 
OnUpdated="UpdateMessage" >
VB code in a head section of the page

<script runat="server">
    Sub UpdateMessage(ByVal source As Object, ByVal e As SqlDataSourceStatusEventArgs)
        If e.AffectedRows > 0 Then
            ' Perform any additional processing, 
            ' such as setting a status label after the operation.        
            Label1.Text = "- Information updated successfully!"
            Label1.Text = "No data updated!"
        End If
    End Sub 'UpdateMessage

Label - message display

<asp:Label ID="Label1" runat="server" CssClass="error" >