Using FindControl() to find control

前端 未结 5 2180
广开言路
广开言路 2021-01-04 06:17

I have a Literal control that I am trying to locate so I can insert text into it. I have a Master page that contains several content placeholders.



        
5条回答
  •  没有蜡笔的小新
    2021-01-04 07:15

    I would try a different approach.

    How about using a user control and exposing the relevant properties to get or set the text value.

    The property would be accessing the literal control. However, the page calling the property wouldn't be any wiser.

    Remember we live in a OO world.

提交回复
热议问题