ITemplate Controls within a User Control can't be found by UpdatePanel Trigger

Posted on 2007-07-25
Medium Priority
Last Modified: 2008-01-09
I have a user control with an ITemplate. I have my user control dropped onto a page inside an UpdatePanel. Inside the template I have a button which I want to cause a full postback. When I add the button to the postback triggers of the UpdatePanel the UpdatePanel can't find the control and I get a runtime error of: A control with ID 'cmdUploadManual' could not be found for the trigger in UpdatePanel 'upManageManuals'. Is there anyway to build my user control so that controls within the template can be found?
Question by:puterart
1 Comment
LVL 18

Accepted Solution

DropZone earned 750 total points
ID: 19678899
Controls within a templated control cannot be accessed at design-time because the template is parsed at run-time.  Also, there is no direct access to the controls within the template, and you'll have to search for them.  You then will have to register your event programmatically.  For example (C#):

    object cmdButton = upManageManuals.FindControl("cmdUploadManual");
    if (cmdButton != null) {
        cmdButton.Click += new System.EventHandler(upManageManuals_CmdClick);

I hope this helps.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question