Last post Feb 26, 2010 02:50 PM by datta.bandgar
Feb 26, 2010 09:32 AM|datta.bandgar|LINK
I have One user Control on page which is used for displaying error.Every page use that user control for showing Error on that page.It has methods for adding and removing errors.
On One Of My page I have User Control say it as UserControlA(this page also have Error user control).If there is any error occured on UserControlA then I have to get the Error Control present in its parent page for display error.
Cuurently I am Finding the each controls in ContentPlaceHolder of its parent page to get error control from parent page.
Is there any better approach rather than finding each control ContentPlaceHolder ?
Feb 26, 2010 10:49 AM|rtpHarry|LINK
Rather than having to know the name of the ContentPlaceHolder you could make it a bit more generic and use the Parent property of the UserControl:
Feb 26, 2010 01:01 PM|datta.bandgar|LINK
Feb 26, 2010 02:29 PM|rtpHarry|LINK
So the error display control is in the content panel? not the masterpage?
Feb 26, 2010 02:50 PM|datta.bandgar|LINK
ya... its Like i have following structure
Master page1 (Common across all pages and viewed only when user is logged in)
Master page2 using Master page1
.aspx page has two user control "ErrorControl" and "UserControlA"(which are inside contentPlaceHolder) and using Master page2
If There is error occured on UserControlA's Page_load() then i have to find ErrorControl(which is user control)on .aspx page to add error messages into it.