Retrieve the control parameters while item context is not available

If you would like to retrieve the control parameters while item context is not available.you can use following code


Sitecore.Data.Database db = Sitecore.Data.Database.GetDatabase("database name");
DeviceItem di = DeviceItem.ResolveDevice(db);

Item item = db.GetItem("Pass the Item ID to retrieve it from database");
Sitecore.Layouts.RenderingReference[] rendering = item.Visualization.GetRenderings(di, true);
Sitecore.Layouts.RenderingReference rendItem = rendering.FirstOrDefault(rend => rend.RenderingItem.InnerItem.Paths.FullPath == "compare with control name for which you would like to retrieve parameters");
System.Collections.Specialized.NameValueCollection parameterCollection = Sitecore.Web.WebUtil.ParseUrlParameters(rendItem.Settings.Parameters);