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

Inner Content Property in UserControl

Hi,

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..
</MyControls:MyControl>

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?
0
pat333
Asked:
pat333
  • 2
1 Solution
 
b1xml2Commented:
The User Control does not allow literal content between its tags....
0
 
pat333Author Commented:
And there is no way to circumvent this? What about nesting another control that would hold the property instead?
0
 
b1xml2Commented:
There's no way to circumvent this, UserControl does not accept any literal content as well as any child control.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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