开发者

usercontrol in a placeholder

I've tried doing the following:

        var userControl = UserControls.ProductDetailUserControl();
        use开发者_JS百科rControl.ID = "id_SubProduct_"+productId;
        userControl.Visible = true;
        userControl.ValidationDependentOnControl = productOption.ClientID;
        userControl.ConditionallyVisible = productOption;
        plhDetails.Controls.Add(userControl);

throws a null exception


Try this

 var uProductDetails = (UserControls.ProductDetailUserControl)Page.LoadControl("UserControls/ProductDetailUserControl.ascx");

    //set properties     
    plhDetails.Controls.Add(userControl);   
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜