Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Data driven template View modes: 
User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 5/27/2013 5:44:06 AM
   
Data driven template
Hi,

I have a page. It has drop down developed using css/html. The drop down has various locatio names like "California", "Texas" etc. These are locations template. What I want is, on clicking of any location, I should be able to show data for that location. I want to use a common template.

How can I achieve that? It's a very simple nothing fancy.


User avatar
Kentico Support
Kentico Support
kentico_radekm - 5/27/2013 5:53:28 AM
   
RE:Data driven template
Hello.

I don't see how exactly did you develop your Drop-down list control, but usual approach in .NET would be using custom user control (.ascx file) with ASP.NET DropDownList control. This control handles OnSelectedIndexChanged event, allowing performing any custom action when some selection is made. If you could describe your scenario more in details, I can provide further info. Thank you.

Best Regards,
Radek Macalik

User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 5/27/2013 6:07:13 AM
   
RE:Data driven template
I have not used any control for drop down. Its a simple light weight drop-down built using html/css. Which shows drop down list on hover on a particular element.

Now what I want, if I select any element from a drop-down it should render, using common locations template, data specific for that selected option.

I have been java/python developer for 8 years. I am working on .NET for the first time.

I hope my question is clear enough now?

User avatar
Member
Member
eagleag - 5/27/2013 7:31:20 AM
   
RE:Data driven template
Hi,

I see 2 simple option:

1) - create a new document type 'CountryInfo" with 2 fields: CountryName, CountryInfo
- use simple two REPEATER web parts.
ONE for creating dropdown with CountryNames
TWO for getting all CountryInfo

load both webparts and then use javascript to show/hide want you want.

2) same idea but instead of document type you create a new custom table


if you prefer that the page reload each time you select a country let me know and I'll suggest a different way.



User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 5/27/2013 7:33:07 AM
   
RE:Data driven template
Page reload is not a problem.

User avatar
Certified Developer 12
Certified Developer 12
chetan2309-gmail - 5/27/2013 12:41:10 PM
   
RE:Data driven template
Page reloading is not a problem. Please let me know your approach