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

Eventhandler in Usercontrol is null

2 Answers 26 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Amirtha S
Top achievements
Rank 1
Amirtha S asked on 01 Mar 2011, 06:20 AM
Hi
We have an aspx page with a usercontrol lying directly in the page and a tabstip with usercontrols dynamically loaded on each tab on demand.

Based on the save operation of user control inside a particular tab, we would like to refresh data in the user controls that direcly place in the aspx page.

But the problem is the evenhandler is always null inside the usercontrol in the tabstrip.

Are we using the right code to handle this?

Here is the code from ascx control residing inside a tab:
private System.EventHandler ButtonResSaveClicked; 
    
        public event EventHandler BtnResSaveClicked 
        
            add 
            { ButtonResSaveClicked += value; } 
            remove 
            { ButtonResSaveClicked -= value; } 
    
        
    
    
protected void btnSave_Click(object sender, EventArgs e) 
        
           //Perform save operation 
           if (ButtonResSaveClicked != null) 
                        
                            ButtonResSaveClicked(sender, e); 
                        
    
           }

Related code in aspx page:
ucFromTab.ButtonResSaveClicked+= ucInPage.RefreshData;



Any of your response will be of great help to me.

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 04 Mar 2011, 09:15 AM
Hi Amirtha,

Could you please open a support ticket and send us a sample project of your implementation? We will test it locally and try to provide you with a solution.


Greetings,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Me Mo
Top achievements
Rank 1
answered on 20 Jun 2011, 04:03 PM
 
Tags
TabStrip
Asked by
Amirtha S
Top achievements
Rank 1
Answers by
Peter
Telerik team
Me Mo
Top achievements
Rank 1
Share this question
or