Re: .text not updatting

  •  01-09-2006, 2:32 PM

    Re: .text not updatting


    In the page_load, I set editor1.text  = data from a database call.


    Below is the Button click sub that updates the database. Editor1.text in this function does not reflect the changes made in the editor.

    Protected Sub SaveChangesBut_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SaveChangesBut.Click

    Dim connstr As ConnectionStringSettingsCollection = ConfigurationManager.ConnectionStrings

    Dim sqlConn As New SqlConnection(connstr("SRHSWeb").ConnectionString)

    Dim strsql As String

    Dim cmd As SqlCommand

    sqlConn.Open()

    strsql = "update editpages set body = '" & Replace(Editor1.Text, "'", "''") & "' where id = " & Request("editpageid")

    cmd = New SqlCommand(strsql, sqlConn)

    Dim NewID As Integer = cmd.ExecuteScalar

    cmd.Dispose()

    EditPanel.Visible = False

    NormalPanel.Visible = True

    FormView1.DataBind()

    End Sub

View Complete Thread