Last post May 23, 2011 01:59 PM by kanthaa
May 23, 2011 10:35 AM|kanthaa|LINK
Question: Display messages on top of the control giving performance problem.
I have strange requirement like i need to display custom messageon top of the control. I can display but in my applicaion every thing is need to place
inside the table.
Let say i have textbox control so i need to find whether that control is need to display custommessage or not ?
So my implementation is , i have inherited all the controls who wants to display custom message from ICustomMessageInfo interface.
Then in serverside i am verifying each row and each cell is there and control inheriting ICustomMessageInfo...?
Let say i got one control then am adding new row and transforing all controls to newrow. then i am placing my message on top of the cell.
It is fine. But the problem is performance...? I got serious performance problem.
Any help please .....?
May 23, 2011 12:04 PM|Lateef045|LINK
There are two flaws in your approach.
1. Going through each control on the page to check if it is inherited from ICustomMessageInfo interface. If there are 100 controls on the page and you have 10 controls that inherits from ICustomMessageInfo interface. This means you are visiting 90 controls
that is not required.
Suggested Solution : Try to maintain a list on each page that will hold the controls that are inherited. Maybe you will have to go through all controls once (to fill this list), but on successive request you will directly have a references in this list.
2. Performance is degraded while shifting cells down and moving controls.
Suggested Solution : When you are inheriting the control, try to design the control such that it has two rows. The bottom row contains the control and the above row holds a label that will display the message. If there is no message, the label will be empty.
May 23, 2011 01:59 PM|kanthaa|LINK
Thank you for your mail.
Thank you for your 2 solutions.
1st solution: I am working for one product , so everything we need to drag and drop my control in to the UI-Panel(dynamic table) . in run time we will refer this one to webpart.
Yes I can get what are all the controls in one list but if i am not setting any custom message ...? again i can set the customessage via script and backend also ..? any solution for this ?
Yes i can agree but we have alredy designed all the controls in this product . Now i can't recreate because of this feature ..
I don't want to recreate my textbox with two rows and ... it will give effect actula textbox functionality. menas in html view instead of text box we will get table + text box that is not good :)