Re: Click Save Button Event

  •  09-23-2005, 2:36 PM

    Re: Click Save Button Event

    Yesterday, after posting the above, I removed my version 4.5 copy of the software and installed the 5.0 version.
     
    I opened the Capture Save codebehind file and tried to change the button text and the Label1 text but could not affect the changes. I made sure when I made my changes via VS2005 that both my local copy of the codebehind file and the copy on my remote webserver was changed. 
    The codebehind file on my webserver has the following code in it:
     

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not Page.IsPostBack Then
                Editor1.Text = "Type Something Here"
            End If

            Dim btn As New System.Web.UI.WebControls.Button
            btn.Text = "Hello Joe"
            'this command would fire to the parent of the btn until be processed
            'CuteEditor catch the CommandEventArgs of child controls,and fired it as PostBackCommand
            btn.CommandName = "Hello"
            btn.Style("vertical-align") = "middle"
            Editor1.AddToolbarLineBreak()
            Editor1.AddToolbarGroupStart()
            Editor1.AddToolControl(btn)
            Editor1.AddToolbarGroupEnd()

            Editor2.Attributes("oncommand") = "HandleEditorCommand(this)"

        End Sub

        Private Sub Editor1_PostBackCommand(ByVal Sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
            If String.Compare(e.CommandName, "Save", True) = 0 Then
                Label1.Text = "<h3>You just clicked the <font color=red>Save Save</font> button</h3>"
            Else
                Label1.Text = "<h3>Just received the bubbled command : " + e.CommandName + " </h3>"
            End If
        End Sub

    The changes I made to the original code are in red.

    You can view the file by going to:

    http://www.hybridrepair.com/HowTo/CatchSave/capture_save_button_click.aspx
     
     
View Complete Thread