Set a default property in a user control?

Discussion in 'ASP .Net' started by =?Utf-8?B?RGF2ZQ==?=, May 14, 2004.

  1. I'm not even sure if what I'm doing is possible. I created a simple control that will be reused throughout the site. It will accept a large amount of HTML with bulleted lists, et

    I want to implement like

    <uc1:KeyFeatures id="KeyFeatures1" runat="server"
    Large amount of Inner Html content goes here between tags..
    </uc1:KeyFeatures

    Not like

    <uc1:KeyFeatures id="KeyFeatures1" runat="server" InnerHtml="Large amount of Inner Html content goes here between tags..."></uc1:KeyFeatures

    Can I do it this way? If so, is this considered the 'default' property and how do I declare this in my uc so it accepts the text between the tags?

    The code is below..this is a stripped down version.

    public class KeyFeatures : System.Web.UI.UserContro

    protected System.Web.UI.WebControls.Label lblInnerHtml

    public string InnerHtml

    se

    lblInnerHtml.Text = value
     
    =?Utf-8?B?RGF2ZQ==?=, May 14, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?RGF2ZQ==?=

    Iyigun Cevik Guest

    If you find can you please tell here how you do?
    Iyigun


    "Dave" <> wrote in message
    news:...
    > I'm not even sure if what I'm doing is possible. I created a simple

    control that will be reused throughout the site. It will accept a large
    amount of HTML with bulleted lists, etc
    >
    > I want to implement like:
    >
    > <uc1:KeyFeatures id="KeyFeatures1" runat="server">
    > Large amount of Inner Html content goes here between tags...
    > </uc1:KeyFeatures>
    >
    > Not like:
    >
    > <uc1:KeyFeatures id="KeyFeatures1" runat="server" InnerHtml="Large amount

    of Inner Html content goes here between tags..."></uc1:KeyFeatures>
    >
    > Can I do it this way? If so, is this considered the 'default' property and

    how do I declare this in my uc so it accepts the text between the tags?
    >
    > The code is below..this is a stripped down version.
    >
    > public class KeyFeatures : System.Web.UI.UserControl
    > {
    > protected System.Web.UI.WebControls.Label lblInnerHtml;
    >
    > public string InnerHtml
    > {
    > set
    > {
    > lblInnerHtml.Text = value;
    > }
    > }
    >
    >
    >
    >
    >
    >
    >
    >
    >
     
    Iyigun Cevik, May 17, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James P.
    Replies:
    4
    Views:
    493
    James P.
    Jun 15, 2004
  2. DC Gringo
    Replies:
    1
    Views:
    5,076
    Karl Seguin
    Apr 26, 2005
  3. ian
    Replies:
    0
    Views:
    388
  4. Jonathan Wood
    Replies:
    2
    Views:
    4,267
    Jonathan Wood
    Feb 8, 2008
  5. Dave

    Can you set a default property for a user control?

    Dave, May 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    159
Loading...

Share This Page