Custom Page - Odd Behavior After 7 to 8

EM DEV asked on July 7, 2014 08:41

I am having some really odd behavior with a custom user control that was created in version 7 and has been upgraded for version 8. It is a control with a series of gridviews/detailsviews that are all dependent on each other. Since the upgrade, clicking on a gridview will cause one to disappear, some require two clicks to fire the selectedindexchanged event, etc. This is just a no frills ascx file coded in vb.net. I can't figure out what has changed in 8 that is causing this behavior and what I can do to make it stop. I have moved some databinds into the page_init event, which has made the page semi functional, but it is still really quirky. This worked fine in Kentico 7. Any help would be GREATLY appreciated!

Recent Answers


Joshua Adams answered on July 7, 2014 09:28

I noticed the same problem with some of my webparts, what I ended up doing is basically rewriting them using the version 8 syntax. I upgraded it, but the behavior was still odd, so I started from scratch and changed some of my page lifecycle functions and where I was calling them. Doing the rewrite seemed to fix it. Another thing you could try is to wrap it in an ajax update panel. Otherwise, I would suggest debugging and seeing where the issues occur.

0 votesVote for this answer Mark as a Correct answer

EM DEV answered on July 7, 2014 09:36 (last edited on July 7, 2014 09:36)

Wow, that is going to be a huge bummer if I have to re-code. I will have to roll back to 7 if that is the case. There is a huge section of one of our websites that I have completely offline right now. After the upgrade I quickly looked at sections of the site and it "appeared" ok. After a couple contact us submissions, I realized how goofed up everything was. It's almost like the page lifecycle has changed from version 7 to 8. Random databound controls lose values on postback.

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on July 7, 2014 09:45

Yea, have you used the Kentico upgrade tool for your upgrade? I did mine by hand, so maybe the tool would be better. Also, I would possibly try to move some of your events around and just experiment with that. Seems to definitely be related to the page lifecycle. Do you use Kentico server controls or just asp.net controls?

0 votesVote for this answer Mark as a Correct answer

EM DEV answered on July 7, 2014 09:48

Yep, used the upgrade tool. I thought everything went really smooth. I have been messing with moving events around, but simple things like selectedindexchanged events require two clicks. This is very simple and should work like regular .net, and did in version 7. I didn't anticipate having troubles like this, so will most likely have to rollback. These are just asp.net controls imported as webparts.

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on July 7, 2014 10:04

Are you testing while in cmsdesk? When you click, do you get javascript errors? Maybe some internal server errors(500)?

0 votesVote for this answer Mark as a Correct answer

EM DEV answered on July 7, 2014 10:14

0 errors. The pages load, just lose values on postbacks for Databound controls.

0 votesVote for this answer Mark as a Correct answer

EM DEV answered on July 7, 2014 12:11

Well, I rolled everything back to version 7. Sites and all custom code work like normal. In fact, I think the websites are more responsive now. I am a little disappointed in this upgrade process. I would be more understanding if I had created some crazy custom one off stuff, but these are all run of the mill .net controls that aren't playing well in version 8.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 7, 2014 12:44

If you're using standard asp.net user controls are you using the User Control webpart to place the user control on the page? If so, the webpart should take care of the lifecycle for you, thats its main purpose.

I've only had a need to create custom user controls for filters, otherwise I've always used webparts, they are much more configurable than standard asp.net user controls and you get to use the UI to vs. having to know what controls are being used in the file system.

0 votesVote for this answer Mark as a Correct answer

EM DEV answered on July 7, 2014 13:04

I used a User Control Webpart to place it on the page. I wanted to move this entire account section into the Kentico Environment, but was under a time crunch at that time and ported code/tied it to cms membership into a standard .net control since it is a pretty large section. It works great in 7, which is why I am a little disappointed and confused as to what is causing the issues in 8.

I will just have to set aside the time to take care of it.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.