Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Webpart displaying little bit differently in kentico 6.0 View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 10/27/2011 4:38:29 PM
   
Webpart displaying little bit differently in kentico 6.0
Hi guys,

I have created webpart in kentico 5.5 but it is showing little bit differently in kentico 6.0

This is the code which is displaying wrongly:


if ((string)this.GetValue("Title1") != "")
{

Message.Text += "<div class=\"accordion-toggle\">" + (string)this.GetValue("Title1") + "<a class=\"accordion-Close-button\" href=\"#\" onclick=\"return reloadAndJump('anchor')\">Close</a></div> ";

Message.Text += "<div class=\"accordion-content\">" + (string)this.GetValue("Content1") + "</div>";

}


Now the problem is even though the field "Title1" is empty it does go inside. So for some reason it thinks that field "Title1" is not empty.

While kentico 5.5 is working perfectly with this code.

Any ideas ?

Thanks
Gitesh Shah

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 10/31/2011 4:43:11 AM
   
RE:Webpart displaying little bit differently in kentico 6.0
Hi,

Could you please check the string against System.String.Empty? It could happen that the field has a space in it which is not null/empty string.

Best regards,
Juraj Ondrus

User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 10/31/2011 9:44:26 PM
   
RE:Webpart displaying little bit differently in kentico 6.0
Hi Juraj,

Below is my new code:


if ((string)this.GetValue("item5Value") != System.String.Empty)
{
DropDownList1.Items.Add(new ListItem((string)this.GetValue("item5"), (string)this.GetValue("item5Value")));
}



It didn't made any difference.

I will Send you the webpart by email , so you can have a better look on the code.

Cheers

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/3/2011 4:25:48 AM
   
RE:Webpart displaying little bit differently in kentico 6.0
Hi,

were you able to debug your code?

Best regards,
Juraj Ondrus