Sunday, 19 January 2014

IsCrossPagePostBack and find previous pages usercontrol value to another page

 if (Page.PreviousPage != null && Page.PreviousPage.IsCrossPagePostBack)
            {
                ContentPlaceHolder cph = (ContentPlaceHolder)Page.PreviousPage.Master.FindControl("MainContent");
                if (cph != null)
                {
                    UserControl ucViewLocateUs = (UserControl)cph.FindControl("ViewLocateUs1");
                    if (ucViewLocateUs != null)
                    {
                        DropDownList dpdListCity = ucViewLocateUs.FindControl("dpdListCity") as DropDownList;
                        FillAllLocateUsDetails(dpdListCity);
                    }
                }
            } 

No comments:

Post a Comment