Search the web
Sign In
New User? Sign Up
sitecore
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Get Parameter Collection for WebControl   Message List  
Reply | Forward Message #3304 of 3315 |
Re: [sitecore] Get Parameter Collection for WebControl

Most Web controls used with Sitecore inherit from Sitecore.Web.UI.WebControl and
override the DoRender() method rather than inheriting from
System.Web.UI.WebControl and overriding the Render() method. This allows the
developer to bind the Web control to a Sitecore placeholder, drag it onto a
layout or sublayout in the Developer Center, and cache its output using Sitecore
output caching.

I believe it would be best to define public properties for each of the
parameters that you need to pass to the Web control. If for some reason this is
not possible, I believe you could pass the parameters using the
Sitecore.Web.UI.WebControl.Parameters property, using the same encoding syntax
used for query-string parameters. I think you could access those parameters
using something like:

NameValueCollection parameters =
Sitecore.Web.WebUtil.ParseUrlParameters(Parameters);

The System.Web.UI.WebControl class does not expose a Parameters property.

The Sitecore Presentation Components Reference and Cookbook provide more
information about implementing Web controls, including passing parameters:

http://sdn.sitecore.net/Reference/Sitecore%206.aspx

--- On Wed, 11/12/08, urvesh.sitecore <urvesh.sitecore@...> wrote:

> From: urvesh.sitecore <urvesh.sitecore@...>
> Subject: [sitecore] Get Parameter Collection for WebControl
> To: sitecore@yahoogroups.com
> Date: Wednesday, November 12, 2008, 10:13 PM
> Hi Everyone,
>
> I have created a WebControl by inheriting from
> System.Web.UI.Control
> class. For a WebControl we can get parameters by declaring
> it as
> public property but in my case, there will be any number of
>
> parameters will be passed. So, if I want to get the list of
> all the
> parameters for the Control, how can I get it?
>
> Here is the definition of class.
> /*****/
> public class MyControl : System.Web.UI.Control
>
> {
>
> }
> /*****/
>
> Thanks and Regards,
>
> Urvesh
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>





Thu Nov 13, 2008 4:21 pm

johnpwest3
Offline Offline
Send Email Send Email

Forward
Message #3304 of 3315 |
Expand Messages Author Sort by Date

Hi Everyone, I have created a WebControl by inheriting from System.Web.UI.Control class. For a WebControl we can get parameters by declaring it as public...
urvesh.sitecore
Offline Send Email
Nov 13, 2008
6:15 am

Most Web controls used with Sitecore inherit from Sitecore.Web.UI.WebControl and override the DoRender() method rather than inheriting from...
John West
johnpwest3
Offline Send Email
Nov 13, 2008
4:21 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help