tag:blogger.com,1999:blog-4126985520350746834.post4578884570607092275..comments2024-03-28T07:00:21.554+00:00Comments on Chris O'Brien: Using the Delegate ControlChris O'Brienhttp://www.blogger.com/profile/10022906552670607366noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-4126985520350746834.post-79185976985181473292013-04-03T11:44:42.467+01:002013-04-03T11:44:42.467+01:00Hi Chris,
How do I find out the controlids ? I tri...Hi Chris,<br />How do I find out the controlids ? I tried to use reflection but it did not help ? Also, on the editprofile.aspx page we added some extra fields and we need a delegate control to override that for some validation.<br /><br />I am using Sharepoint 2007. Any help will be really appreciated. <br />Best Regards<br />JisnuJBhttps://www.blogger.com/profile/07949499692769302521noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-6491623080165773432009-03-12T09:26:00.000+00:002009-03-12T09:26:00.000+00:00@Saurabh,If your control is present when the page ...@Saurabh,<BR/><BR/>If your control is present when the page is loaded then the Delegate Control part of your solution is working fine. I'm you're not 100% sure, suggest putting in some temporary HTML which will allow you to verify this. <BR/><BR/>Once you've proved your control <I>is</I> there, the problem isn't to do with the Delegate Control, so you should look at the other bits. Afraid I'm no jQuery expert so can't really help there.<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-32176043847001561292009-03-03T07:49:00.000+00:002009-03-03T07:49:00.000+00:00Chris.I have tried jQuery in Sharepoint i refered ...Chris.<BR/><BR/>I have tried jQuery in Sharepoint <BR/>i refered <BR/>http://weblogs.asp.net/jan/archive/2008/11/20/sharepoint-2007-and-jquery-1.aspx<BR/><BR/>http://weblogs.asp.net/jan/archive/2008/11/20/sharepoint-2007-and-jquery-2.aspx<BR/><BR/>i used the Delegate control Method.<BR/>i create a user control in controlTemplates folder, create feature, install feature and activate feature and put delegate control at masterpage <BR/><BR/>>SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true" /><BR/><BR/>(i checked my elements.xml i used the same controlId i.e. AdditionalPageHead)<BR/><BR/> then i create an aspx page and put one anchor tag and on click event want to show alert("Hello World");<BR/><BR/>my jQuery code is in aspx file.<BR/><BR/><script type="text/javascript"><BR/> $((document).ready(function() <BR/> {<BR/> $('#anc').click(function()<BR/> {<BR/> alert("Hello World");<BR/> });<BR/> });<BR/></script><BR/><BR/><a id="anc" href="#">Request</a><BR/><BR/>it doesn't work. nothing is happened when m clicking on the anchor.<BR/><BR/>any ideas?<BR/>Kind Regards.<BR/>SaurabhSaurabhhttps://www.blogger.com/profile/16726528914403597997noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-78837620302383957912008-06-30T17:52:00.000+01:002008-06-30T17:52:00.000+01:00Thanks for the article. It gave me a general unde...Thanks for the article. It gave me a general understand of what a delegate control can do and why it is useful...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-63553920304532583672008-05-23T06:33:00.000+01:002008-05-23T06:33:00.000+01:00Nice post, it gives brief about delegate control +...Nice post, it gives brief about delegate control + how to use properties. To know how to use properties please go through -http://msdn.microsoft.com/en-us/library/ms470880.aspxRuchihttps://www.blogger.com/profile/06007781110556181605noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-40050330196726131452008-05-06T08:37:00.000+01:002008-05-06T08:37:00.000+01:00MOSSuMSIt's not ideal, but to set control properti...<A HREF="http://www.sharepointblogs.com/mossms" REL="nofollow">MOSSuMS</A><BR/>It's not ideal, but to set control properties put this is you feature's elements file:<BR/><BR/><Control<BR/> Id="pagesCntrlId"<BR/> controlSrc="~/_controltemplates/feature/cntrl.ascx"<BR/> Sequence="90"><BR/> <Property Name="prop">propVal<BR/> </Property><BR/></Control><BR/><BR/>I hope this helps others use these controls to good effect!<BR/><BR/>Cheers, Mike <A HREF="http://www.sharepointblogs.com/mossms" REL="nofollow">MOSSuMS</A>.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-53777249704128076852008-04-10T14:34:00.000+01:002008-04-10T14:34:00.000+01:00Hi Darren,Thanks for your comment. It's certainly ...Hi Darren,<BR/><BR/>Thanks for your comment. It's certainly true that I haven't tried parameter passing with DelegateControl, and I didn't see it as an 'admission' when I said as much in my earlier note. I included the information in my post because the fact that I haven't tried it doesn't mean it's not useful information for other people starting to look at the control. Clearly it's unfortunate that it doesn't work as advertised. Perhaps I should have added "I haven't tried this" to that bullet point, but I wasn't seeking to indicate that I had tried it.<BR/><BR/>I'm sorry you feel differently.<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-67974266885605086642008-04-10T08:04:00.000+01:002008-04-10T08:04:00.000+01:00Hi Chris, by your own admission you haven't needed...Hi Chris, by your own admission you haven't needed to pass parameters to a DelegateControl yet. This implies that you've never tried it. Why then do you include information in your post on how to pass parameters to a DelegateControl?? A quick test would have shown you this crashes the page, as pointed out by Simon above.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-4605483235898014182008-03-30T17:44:00.000+01:002008-03-30T17:44:00.000+01:00The navigation controls aren't delegate controls, ...The navigation controls aren't delegate controls, they are added in the markup of the master page your site is using. Delegate controls are actually used for the DataSource of the navigation controls, but that's a more subtle thing!<BR/><BR/>In answer to the second question, you definitely can use your own user control with a delegate control. Hopefully the info above (particularly on using the 'ControlSrc' property) will get you started.<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-17223347143189372682008-03-27T17:02:00.000+00:002008-03-27T17:02:00.000+00:00Chris this post is cool. do you know what control ...Chris <BR/><BR/>this post is cool. do you know what control are the top left navigation controls and i can add mu own user control using the delegate control& took the road less travelledhttps://www.blogger.com/profile/05605382895332470809noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-66416976270845607982008-03-26T09:38:00.000+00:002008-03-26T09:38:00.000+00:00Hmm, not sure I follow exactly but I think the ans...Hmm, not sure I follow exactly but I think the answer is no unfortunately. As far as I'm aware there is no way to get access to other delegate controls with the same ID - the control will simply load the one with the lowest ID which matches.<BR/><BR/>Might be worth a quick look with Reflector to check though :-)<BR/><BR/>HTH,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-72135702077601879582008-03-24T23:41:00.000+00:002008-03-24T23:41:00.000+00:00Hi Chris, great article! I have a question: is it ...Hi Chris, great article! I have a question: is it possible to check next delegate control with the same ID in a chain and insert it after the control with a max. sequence?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-31886749709417487162008-02-05T21:42:00.000+00:002008-02-05T21:42:00.000+00:00Hi Chris,OK I've not done this but would think the...Hi Chris,<BR/><BR/>OK I've not done this but would think there are 2 possibilities here:<BR/><BR/>- You can do this by adding the .pdb file to the GAC, and then setting a breakpoint and using the debugger as normal. See my post on <A HREF="http://sharepointnutsandbolts.blogspot.com/2007/03/how-to-debug-sharepoint-feature.html" REL="nofollow">How to debug SharePoint feature receivers</A> for the full rundown - it <I>should</I>be exactly the same.<BR/>- It's not possible to debug code for delegate controls in this way because reflection is used.<BR/><BR/>Be interested to hear the results!<BR/><BR/>Cheers,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-29487205256135481432008-02-04T18:27:00.000+00:002008-02-04T18:27:00.000+00:00ChrisThanks for the post.I have a custom web user ...Chris<BR/><BR/>Thanks for the post.<BR/><BR/>I have a custom web user control that I'm loading with a delegate contral that has a code behind. Do you know how I can attach a debugger to that code? Thanks.Chris Donlanhttps://www.blogger.com/profile/02769295214181670883noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-75255528935492599982008-01-13T19:55:00.000+00:002008-01-13T19:55:00.000+00:00Hi Simon,Hmm, when I've used delegate controls I d...Hi Simon,<BR/><BR/>Hmm, when I've used delegate controls I don't think I've needed to pass parameters yet. But I'm surprised at what you report - the <A HREF="http://msdn2.microsoft.com/en-us/library/ms463169.aspx" REL="nofollow">MSDN documentation for the delegate control</A> certainly mentions being able to do this.<BR/><BR/>Sorry I don't have time to set something up to check this out. I wonder if maybe it's only possible to pass parameters to server controls, not user controls?<BR/><BR/>Anyone else done this?<BR/><BR/>Thanks,<BR/><BR/>Chris.Chris O'Brienhttps://www.blogger.com/profile/10022906552670607366noreply@blogger.comtag:blogger.com,1999:blog-4126985520350746834.post-6483300058824994442008-01-11T02:52:00.000+00:002008-01-11T02:52:00.000+00:00Chris This does not work:<SharePoint:DelegateCo...Chris <BR/><BR/>This does not work:<BR/><BR/><SharePoint:DelegateControl runat="server" ControlId="PageHeader" MyParam="MyValue"><BR/><BR/>Sharepoint will give you an error:<BR/><BR/>An error occurred during the processing of /_catalogs/masterpage/GeneralContent.aspx. Type 'Microsoft. SharePoint.WebControls. DelegateControl' does not have a public property named 'MyParam'.<BR/> <BR/>Am I missing something? I only way I have found to pass parameters to a user control is to use the DelegateControl "ID" property. I really hope this is NOT the only way!!Simonhttps://www.blogger.com/profile/04255274935479582217noreply@blogger.com