How to get a label value from web user control to a content page using master page

前端 未结 3 579
误落风尘
误落风尘 2021-01-27 11:24

I have a web user control book.ascx and a formview:





        
3条回答
  •  广开言路
    2021-01-27 12:08

    From the code behind in the Default.aspx.cs:

    protected void fv_OnDataBound(object sender, EventArgs e) 
    {
        Label fvLabel = (Label)fv.FindControl("bookID");
        lblBookId.Text = fvLabel.Text;
    }
    

提交回复
热议问题