Technical support This forum is closed.
Version 1.x > Technical support > CMSViewer View modes: 
User avatar
Guest
rhavlick - 1/2/2006 6:45:53 PM
   
CMSViewer
Hello,

I am semi new to ASP.NET and first time starting with the CMS product. I've designed a page with multiple transformations for different views on a product. My product has attributes like description, feature list, benefits, etc.

I have a Page Template that has a few links on the left side and a CMSViewer on the right. What I'd like to do is when a link is clicked on the left, have the TransformationName property change and update the page.

I have that all working, however you have to click the link 2 times before it updates the CMSViewer. What it appears to be doing is updating the TransformationName property after the page has been rendered. Is there any way to have the link clicked, and then update the property before the page is rendered?

Thanks.

User avatar
Guest
admin - 1/3/2006 1:25:32 PM
   
Re: CMSViewer
Hello,

Thank you for your post. You're probably using a link button, arent' you? In Kentico CMS, you usually do not need to make postbacks. Instead, you use different URLs or URL parameters to specify what (and how) should be displayed. The advantage of this way is that you can easily send a link to any (product) view to other people and they will see exactly what you saw.

Of course, postbacks are supported in Kentico CMS web sites, only in this case, this solution will not work for you as the CMSViewer control displays the content before your postback (onclick) action is run. You could use a workaround and create two CMSViewer controls with different settings and show/display each of them depending on the situation.

However, I would rather recommend another way - here's a typical solution with Kentico CMS (simplified):

If the user selects a list of products, the URL is like this: http://localhost/cms/products.aspx. The CMSRepeater (or other control) displays the list of product using the transformation specified in the TransformationName property.

If the user selects some particular product and wants to display its details, he/she is redirected to URL like this: http://localhost/cms/products/nokia6600.aspx. The CMSRepeater displays the list of products using the transformation specified in the SelectedItemTransformationName property.

If you need to create several different detailed views (such as "overview" and "technical specification"), you can create a link, such as <a href="?view=technical">See technical details</a> and then check in the Page_Load method if Request.Querystring("view") = "technical" and set the CMSViewer properties in the Page_Load method.

Should you need any additional details, please feel free to contact me at petr.palas@kentico.com.

Thank you.

Best Regards,

User avatar
Guest
rhavlick - 1/3/2006 3:46:37 PM
   
Re: CMSViewer
Thank you very much.

User avatar
Guest
rhavlick - 1/3/2006 4:35:18 PM
   
Re: CMSViewer
I'm actually running into a really strange problem. The Page_Load event is never being called on any of my pages in the application. Is there something I need to change to have this fired?

Thanks.

User avatar
Guest
admin - 1/4/2006 5:56:43 PM
   
Re: CMSViewer
Well, could you please send me that page (aspx and code-behind file) to petr.palas@kentico.com?

Thank you.

Best Regards,