when add dynamic control in update panel then getting failed to load viewsate error ?

Posted by Tushar Maru on Stack Overflow See other posts from Stack Overflow or by Tushar Maru
Published on 2009-12-07T09:00:25Z Indexed on 2010/03/29 18:03 UTC
Read the original article Hit count: 559

Filed under:
|

when add dynamic control in update panel then getting failed to load viewsate error ?

see following example :-

UpdatePanel panel = new UpdatePanel();

panel.ContentTemplateContainer.Controls.Clear(); if (strPopupType == "O") { Control ctrl = Page.LoadControl(@"~/Modules/MLM/UnilevelViewer/DesktopModules/OrderDetails.ascx");

            OrderDetails orderdetails = (OrderDetails)ctrl;
            orderdetails.ID = "Orders" + elementID;
            orderdetails.OrderID = Convert.ToInt32(elementID);
            //orderdetails.ModuleSkinStyleName = CurrentModuleSkin;
            panel.ContentTemplateContainer.Controls.Add(ctrl);
        }
        else if (strPopupType == "U")
        {
            Control ctrl = Page.LoadControl(@"~/Modules/MLM/UnilevelViewer/DesktopModules/UserDetails.ascx");

            UserDetails userdetails = (UserDetails)ctrl;
            userdetails.ID = "Users" + elementID;
            // userdetails.UserModuleSkinStyleName = CurrentModuleSkin;
            userdetails.UserID = new Guid(elementID);

            panel.ContentTemplateContainer.Controls.Add(ctrl);
        }

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-ajax