User Control not able to invoke event.

2 posts, 0 answers
  1. eran
    eran avatar
    14 posts
    Member since:
    Jul 2010

    Posted 27 Jul 2011 Link to this post

    Hi Telerik,

    I am having problem after i load a user control to radsplitter. i am not able to fired the event that i created in the ascx. is there anyway i can invoke the event ?

    In aspx
    Imports Telerik.Web.UI
    Partial Class Admin
        Inherits System.Web.UI.Page
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not IsPostBack Then
                RadPane11.Controls.Add(LoadControl("~/Admin/Insert Landmark.ascx"))
            End If
        End Sub
        Protected Sub RadPanelBar1_ItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadPanelBarEventArgs) Handles RadPanelBar1.ItemClick
            Dim ItemClicked As RadPanelItem = e.Item
            RadPane11.Controls.Add(LoadControl("~/Admin/" & ItemClicked.Text & ".ascx"))
        End Sub
    End Class

    in ascx.
    Imports Telerik.Web.UI
    Partial Class Admin_InsertLandmark
        Inherits System.Web.UI.UserControl
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        End Sub
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
            If RadUpload1.UploadedFiles.Count > 0 Then
                For Each f As UploadedFile In RadUpload1.UploadedFiles
                    Dim landmarkname As String = TextBox1.Text
                    Dim landmarkaddress As String = TextBox2.Text
                    Dim landmarkphotourl As String = f.FileName
                    f.SaveAs("D:\LandMarkImage\" + f.FileName)
            End If
        End Sub
    End Class

    P.S. i load the ascx dynamically.

  2. Dobromir
    Dobromir avatar
    1633 posts

    Posted 01 Aug 2011 Link to this post


    I am not quite sure I understand the exact scenario. Could you please describe in more details what exactly you are trying to achieve?

    According to the provided sample code snippet I assume that the Button1_Click event is not fired from the usercontrol. I tried to reproduce this in a simple scenario but to no avail. Could you please open a formal support ticket and provide a sample fully runnable project demonstrating the problem so we can examine and debug it locally?

    Kind regards,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top