Problem in UpdateToolTip()

1 posts, 0 answers
  1. jpchenot
    jpchenot avatar
    20 posts
    Member since:
    Jan 2008

    Posted 21 Jan 2008 Link to this post


    When I write the code to update the tooltip in my vb code I get the error:
        - Cannot convert type system.web.ui.control to content.

    Content is my web usercontrol. Here is my code


    Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
    Dim ctrl As UserControl = Page.LoadControl("~/secured/admin/Content.ascx")   panel.ContentTemplateContainer.Controls.Add(ctrl)
    Dim content As Content = DirectCast(ctrl, Content)
    content.ContentID = elementID
    End Sub

    The error is on the ctrl element. I have copied the code from the demo, so it should work. I don't understand what's wrong.



Back to Top