tag:blogger.com,1999:blog-1400873539908712350.post163470452543287383..comments2023-10-16T00:16:29.644-07:00Comments on Eric Huiza: Improving Tridion .Net Controls - Component PresentationAnonymoushttp://www.blogger.com/profile/00370895940423689366noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-1400873539908712350.post-33697773631367904512022-06-10T18:22:55.826-07:002022-06-10T18:22:55.826-07:00Charming, notice. I just tracked down your blog an...Charming, notice. I just tracked down your blog and expected to declare that i've esteemed examining your weblog posts. Once more after every one in all degree of part of, I can really get involved with your feed, and that I objective you could form quickly! <a href="https://wishesquotz.com/birthday-wishes-for-father/" rel="nofollow">Dad Birthday Wishes</a>Cyberz Pchttps://www.blogger.com/profile/17525852163198790986noreply@blogger.comtag:blogger.com,1999:blog-1400873539908712350.post-55612778124284039892022-06-08T21:00:55.330-07:002022-06-08T21:00:55.330-07:00this is a particularly wonderful helpful asset whi...this is a particularly wonderful helpful asset which you are offering and you find the money for it away for justifiable. I truly like seeing site that arrangement the charge of providing an energies helpful asset for excuse. <a href="https://cyberspc.com/convertxtodvd-crack/" rel="nofollow">Convertxtodvd Cracked</a>Links For Youhttps://www.blogger.com/profile/07712534923715855362noreply@blogger.comtag:blogger.com,1999:blog-1400873539908712350.post-15936193056558187322022-06-08T19:04:17.499-07:002022-06-08T19:04:17.499-07:00Best plug! this is an each level of simple to appl...Best plug! this is an each level of simple to apply weblog that I can conclusively come steerage to more noteworthy age this yr! gratitude for educational announce. <a href="https://crackdj.com/bandicam-keygen-full-crack-download/" rel="nofollow">Bandicam Crack Keygen</a>Let2knowhttps://www.blogger.com/profile/01547529398416070781noreply@blogger.comtag:blogger.com,1999:blog-1400873539908712350.post-30968697620267915822018-08-22T04:06:23.981-07:002018-08-22T04:06:23.981-07:00This blog gives very important info about .Net
...This blog gives very important info about .Net <br /> <a href="https://onlineitguru.com/dot-net-online-training-placement.html" rel="nofollow"> .Net Online Training Hyderabad</a>rmouniakhttps://www.blogger.com/profile/06622438005105687926noreply@blogger.comtag:blogger.com,1999:blog-1400873539908712350.post-46358759873838605452015-05-08T07:07:41.875-07:002015-05-08T07:07:41.875-07:00private static void UpdateCache(string virtualPath... private static void UpdateCache(string virtualPath, IItem componentMeta)<br /> {<br /> if (HttpContext.Current == null)<br /> return;<br /><br /> if (HttpContext.Current.Cache[virtualPath] == null)<br /> {<br /> HttpContext.Current.Cache[virtualPath] = componentMeta.LastPublicationDate;<br /> return;<br /> }<br /><br /> var lastPublishedDate = (DateTime) HttpContext.Current.Cache[virtualPath];<br /> if (lastPublishedDate >= componentMeta.LastPublicationDate)<br /> return;<br /><br /> HttpContext.Current.Cache[virtualPath] = componentMeta.LastPublicationDate;<br /> }Anonymoushttps://www.blogger.com/profile/09589515724045151336noreply@blogger.comtag:blogger.com,1999:blog-1400873539908712350.post-59176259380689266462015-05-08T07:07:15.591-07:002015-05-08T07:07:15.591-07:00The function CreateChildControls function is by fa...The function CreateChildControls function is by far badly written:<br />protected override void CreateChildControls() {<br />// Don't need to check this here. Why you check the current context here? If you are only using it in the CacheInvalidation function.<br />// If there is no context, you are just not doing anything when you could in fact render the component w/o complications, but don't update cache.<br /><br /> if (HttpContext.Current != null && HttpContext.Current.Application != null) {<br /> ComponentPresentationMeta meta = new ComponentPresentationMetaFactory(ComponentUri).GetMeta(ComponentUri, TemplateUri);<br /> if (meta != null) {<br /> string contentType = meta.ContentType;<br /> if (contentType.StartsWith("ASCX")) {<br /><br />// Why do you create the factory? Not using the componentPresentation object for anything.<br /> using (ComponentPresentationFactory factory = new ComponentPresentationFactory(ComponentUri)) {<br /> Tridion.ContentDelivery.DynamicContent.ComponentPresentation componentPresentation =<br /> factory.GetComponentPresentation(ComponentUri, TemplateUri);<br /><br /><br /> TcmUri componentId = new TcmUri(ComponentUri);<br /> TcmUri templateId = new TcmUri(TemplateUri);<br /><br /> ComponentMetaFactory metaFactory = new ComponentMetaFactory(componentId.PublicationId);<br /> IComponentMeta componentMeta = metaFactory.GetMeta(componentId.ItemId);<br /><br /> string virtualPath = string.Format("dcp_{0}_{1}.ascx", componentId.ItemId, templateId.ItemId);<br /> CacheInvalidation(virtualPath, componentMeta);<br /><br /> Control control = Page.LoadControl(virtualPath);<br /> this.Controls.Add(control);<br /> }<br /> }<br /> else {<br /> Tridion.ContentDelivery.Web.UI.ComponentPresentation componentPresentation = new Tridion.ContentDelivery.Web.UI.ComponentPresentation();<br /> componentPresentation.Page = this.Page;<br /> componentPresentation.PageUri = PageUri;<br /> componentPresentation.ComponentUri = ComponentUri;<br /> componentPresentation.TemplateUri = TemplateUri;<br /> this.Controls.Add(componentPresentation);<br /> componentPresentation.Dispose();<br /> }<br /> }<br /> }<br /> }<br /><br />The fixed code should be something like:<br /> protected override void CreateChildControls()<br /> {<br /> var meta = new ComponentPresentationMetaFactory(ComponentUri).GetMeta(ComponentUri, TemplateUri);<br /> if (meta == null)<br /> return;<br /> <br /> var contentType = meta.ContentType;<br /> if (contentType.StartsWith("ASCX"))<br /> {<br /> var componentId = new TcmUri(ComponentUri);<br /> var templateId = new TcmUri(TemplateUri);<br /><br /> var componentMeta = (new ComponentMetaFactory(componentId.PublicationId)).GetMeta(componentId.ItemId);<br /><br /> var virtualPath = string.Format("dcp_{0}_{1}.ascx", componentId.ItemId, templateId.ItemId);<br /> UpdateCache(virtualPath, componentMeta);<br /><br /> Controls.Add(Page.LoadControl(virtualPath));<br /> }<br /> else<br /> {<br /> var componentPresentation = new Tridion.ContentDelivery.Web.UI.ComponentPresentation<br /> {<br /> Page = Page,<br /> PageUri = PageUri,<br /> ComponentUri = ComponentUri,<br /> TemplateUri = TemplateUri<br /> };<br /> Controls.Add(componentPresentation);<br /> componentPresentation.Dispose();<br /> }<br /> }<br />Anonymoushttps://www.blogger.com/profile/09589515724045151336noreply@blogger.comtag:blogger.com,1999:blog-1400873539908712350.post-2616747948762783552014-03-16T23:57:42.287-07:002014-03-16T23:57:42.287-07:00Sounds like the C# UI controls I'd ever seen.Sounds like the <a href="http://www.kettic.com/" rel="nofollow">C# UI controls</a> I'd ever seen.Uchiha Itachihttps://www.blogger.com/profile/13845239114624923142noreply@blogger.comtag:blogger.com,1999:blog-1400873539908712350.post-85060283540642145512013-10-04T12:05:57.351-07:002013-10-04T12:05:57.351-07:00Excellent point on the ASP.NET lifecycle--I've...Excellent point on the ASP.NET lifecycle--I've mistakenly assumed forms would work fine with a regular .NET dynamic component presentation. So in our CMS designs, we can still consider "config" or "widget" type setups, but I should probably be aware of how the controls render in delivery (and when).Nivlonghttps://www.blogger.com/profile/06783255433284043555noreply@blogger.com