• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 472
  • Last Modified:

Inner Content Property in UserControl


I would like to create a User Control that accepts a property between its opening and closing brackets in the htm, such that I can obtain the value in the code-behind for the control.

i.e. something like :

<MyControls:MyControl id="ctl" runat="server">
    ..some literal text here..

And ".. some literal text here.." would be accessible as a property in the control.

How would I go about implementing this within a User Control? Or is it something that is only possible with Server Controls?
  • 2
1 Solution
The User Control does not allow literal content between its tags....
pat333Author Commented:
And there is no way to circumvent this? What about nesting another control that would hold the property instead?
There's no way to circumvent this, UserControl does not accept any literal content as well as any child control.

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now