Set TargetControlId Of Extender In UserControl To Control On Another Page

Last post 06-27-2007 4:32 PM by keyboardcowboy. 3 replies.

Sort Posts:

  • Set TargetControlId Of Extender In UserControl To Control On Another Page

    06-27-2007, 2:49 PM
    • Member
      290 point Member
    • lmf232s
    • Member since 12-09-2003, 5:01 PM
    • Posts 93

    I have a user control that contains the Modal Popup control.

    I would like to set the Target Control Id of the ModalPopupExtender to be a control that is located on a different page.

    For example I have my master page and I need to include the user control. But i want a button that is on the Master Page to be the TargetControlId.

     The problem Im having is that If I include the control that initiates the extender into the usercontrol, then when that user control is placed on the Master Page, its inherating all the Styles of the <div> on the master page its being placed in which is a problem.

    What i would like to do is create the user control and then include it in the master page outside of the main content area but then put a image button with in the header which would then call the extender.

    When i do this i get the error:The TargetControlID of 'ModalPopupExtender' is not valid. A control with ID 'ctl00_cmdGetHelp' could not be found.

    Master Page: Image button renders with Id of ctl00_cmdGetHelp

    UserControl: I set the TargetControlId to : "ctl00_cmdGetHelp"

    Again this causes an error.

     Any ideas??

  • Re: Set TargetControlId Of Extender In UserControl To Control On Another Page

    06-27-2007, 3:54 PM
    • Contributor
      5,529 point Contributor
    • keyboardcowboy
    • Member since 06-14-2007, 3:39 PM
    • Thornhill Ontario
    • Posts 1,045

    is ctl00_cmdGetHelp the ID or uniqueID. im not sure but it seems like you are setting the target ID to the uniqueID in which case it might not find that control ID because you never initiate the controlID. (i cant remember if you leave ID blank if it automatically becomes the uniqueID) but trying doing:

    cmdGetHelp.ID = "cmdGetHelp";

    extender.TargetControlID = cmdGetHelp.ID; or extender.TargetControlID = "cmdGetHelp";

    Please remember to click "Mark as Answer" on this post if it helped you.
  • Re: Set TargetControlId Of Extender In UserControl To Control On Another Page

    06-27-2007, 4:26 PM
    • Member
      290 point Member
    • lmf232s
    • Member since 12-09-2003, 5:01 PM
    • Posts 93

    cowboy,

    Thanks, not sure why i made that so difficult. I could of sworn that I tried what I posted before I posted.
    For some reason I was trying to set the UniquieId and not the ID of the control.

    This is one of those posts where I posted prematurely. Should of worked on it a bit longer.

    Any way, ya it works.

    Master page: Image button ID="cmdGetHelp"

    UserControl:  ModalPopupextender TargetControlId="cmdGetHelp"

     Thanks

  • Re: Set TargetControlId Of Extender In UserControl To Control On Another Page

    06-27-2007, 4:32 PM
    • Contributor
      5,529 point Contributor
    • keyboardcowboy
    • Member since 06-14-2007, 3:39 PM
    • Thornhill Ontario
    • Posts 1,045

    glad to help

    Please remember to click "Mark as Answer" on this post if it helped you.
Page 1 of 1 (4 items)