Re: Problem with Saving Edited File

  •  03-16-2006, 1:46 PM

    Re: Problem with Saving Edited File

    I trieIm having the same problem. The edited file is not saved. The code is:

     Public Sub Editor1_PostBackCommand(ByVal Sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
            If String.Compare(e.CommandName, "Save", True) = 0 Then
               
                Try
                   If nuevoId = "" Then
                        Me.Label1.Visible = True
                        Me.Label1.Text = "Debe especificar un Identificador"
                    ElseIf Me.newTitle.Value = "" Then
                        Me.Label1.Visible = True
                        Me.Label1.Text = "Debe especificar un titulo"
                    Else
                        xNode = dataAccess.getNodoById(nuevoId)
                        pnode = dataAccess.getNodoById(pid)
                        If xNode Is Nothing Then
                            xNode = pnode.CloneNode(False)
                            If pid = "Root" Then
                                xNode.Attributes("levelRoot").Value = "true"
                            Else
                                xNode.Attributes("levelRoot").Value = "false"
                            End If
                            xNode.Attributes("default").Value = "false"
                            xNode.Attributes("Control").Value = "WUCHtmlRender"
                            xNode.Attributes("Title").Value = Me.newTitle.Value
                            xNode.Attributes("ID").Value = nuevoId
                            If pnode.Attributes("levelRoot").Value = "true" Then
                                xNode.Attributes("group").Value = "true"
                            Else
                                xNode.Attributes("group").Value = "false" 'una página se crea sin ser grupo
                            End If

                            pnode.AppendChild(xNode)
                            dataAccess.saveSiteMap()

                            Editor1.SaveFile(System.AppDomain.CurrentDomain.BaseDirectory & "/Resources/HtmlContent/" & Me.newID.Value & ".en.htm")
                        Else
                            Me.Label1.Text = "Ya existe un docuento con el ID: " & Me.newID.Value
                            Me.Label1.Visible = True
                        End If
                    End If

                Catch ex As Exception
                    Me.Label1.Text = ex.Message
                    Me.Label1.Visible = True
                End Try
            End If
        End Sub

    thanks

View Complete Thread