This is a migrated thread and some comments may be shown as answers.

User Control not able to invoke event.

1 Answer 49 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
eran
Top achievements
Rank 1
eran asked on 27 Jul 2011, 12:23 PM
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"))
        RadPane()
    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)
            Next
        End If
    End Sub
End Class

P.S. i load the ascx dynamically.

Regards,
KEA

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 01 Aug 2011, 11:02 AM
Hi,

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,
Dobromir
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.

Tags
Splitter
Asked by
eran
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or