Announcement

Collapse
No announcement yet.

divToUpdate not rendering

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    divToUpdate not rendering

    I have never had success with using divToUpdate to dynamically alter a plugin web page. I have taken the Sample from the SDK with only edits to reflect the plugin name and page and I can trap on the postBackProc in VisualStudio to watch the execution of the attempted update, but never see anything change on the browser page. Looking at this board I see many have success so should be something simple that I am missing.

    IFACE_NAME was used in the SDK as a parameter to build the jquery button. When I do this then I do not get the callback when the button is pressed. What does work for me is the page name rather than the interface name as the parameter. The other difference is the SDK did not have sufficient parameters for hs.GetPageHeader so I added a string parameter so it would compile.

    All other aspects of my jQuery-based pages work, but just not the dynamic update of HTML between div tags.

    Code:
    Class TESTASP
    
        Inherits clsPageBuilder
        Implements IDisposable
    
        Private TEST_PAGE = "Test"
        Public Sub New() 'ByVal pagename As String)
            MyBase.New(TEST_PAGE)
        End Sub
    
    Public Overrides Function postBackProc(page As String, data As String, user As String, userRights As Integer) As String
                Me.divToUpdate.Add("current_time", "ABC")
                Return ""
    end Function
    
    Public Function GetPagePlugin(ByVal pageName As String, ByVal user As String, ByVal userRights As Integer, ByVal queryString As String) As String
            Dim stb As New StringBuilder
    
            Try
                Me.reset()
                Dim parts As Collections.Specialized.NameValueCollection = Nothing
                If (queryString <> "") Then
                    parts = HttpUtility.ParseQueryString(queryString)
                End If
                Me.AddHeader(hs.GetPageHeader(TEST_PAGE, TEST_PAGE, "", "", True, False)) 
                stb.Append(clsPageBuilder.DivStart("pluginpage", ""))
                stb.Append(clsPageBuilder.DivStart("errormessage", "class='errormessage'"))
                stb.Append(clsPageBuilder.DivEnd)
                stb.Append("<div id='current_time'>" & DateTime.Now.ToString & "</div>" & vbCrLf)
                Dim b As New clsJQuery.jqButton("b1", "Button", TEST_PAGE, False)
                stb.Append(b.Build)
                stb.Append(clsPageBuilder.DivEnd)
                Me.AddBody(stb.ToString)
                Me.AddFooter(hs.GetPageFooter)
                Me.suppressDefaultFooter = True
                Return Me.BuildPage()
            Catch ex As Exception
                'WriteMon("Error", "Building page: " & ex.Message)
                Return "error"
            End Try
        End Function
    End Class
Working...
X