Skip to content

CssClass property for a UserControl (Apply CSS code to a UserControl element inside it) #1039

Description

@itg-assistant

Eric Mathay asked 2017-08-22 09:28:43 UTC

Hello,

I have created a Usercontrol containing 1 Label.

I have added a styleSheet control to the usercontrol. This adds a property 'CssClass' to label1 when in the Designer.

I want to expose the 'CssClass' property outside of the usercontrol by defining a new property, but cssclass isn't available.

Error CS1061 'Label' does not contain a definition for 'CssClass' and no extension method 'CssClass' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?)

namespace WebPage2
{
public partial class UserControl1 : Wisej.Web.UserControl
{
public override string Text
{
get { return label1.Text; }
set { label1.Text = value; }
}
public override string CssClass
{
get { return label1.CssClass; }
set { label1.cssclass = value; }
}

public UserControl1()
{
InitializeComponent();
}
}
}

Do I miss something ?

Best regards.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions