• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 472
  • 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

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