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
>
>
>