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

Posted on 2007-07-25
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

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now