Tech Off Thread

5 posts

How to: ASP.NET user controls?

Back to Forum: Tech Off
  • User profile image
    Cybermagell​an

    I'm trying to move my team from using regular ASP.NET controls over to using HTML5 related controls however (for some reason), they're in love with actually using the toolbox controls.

    Is there any idiots guide to writing toolbox controls (user controls)? From within VB? If needed I'll write the HTML5 elements as controls for my team... thanks.

  • User profile image
    itsnotabug

    couldn't you just inherit the literal control and write your control in pure html and js?

     

    *edit** nevermind, looks like you're trying to add it to the toolbox. sorry, i've never done that ***

  • User profile image
    figuerres

    , Cybermagell‚Äčan wrote

    I'm trying to move my team from using regular ASP.NET controls over to using HTML5 related controls however (for some reason), they're in love with actually using the toolbox controls.

    Is there any idiots guide to writing toolbox controls (user controls)? From within VB? If needed I'll write the HTML5 elements as controls for my team... thanks.

    look at how when the ajax stuff first came out MS had a set of "control adapters" that you could add an xml file to a site and the controls listed would get proper html generated.

    if you can go that route then you can just override the rendering but use the standard controls

  • User profile image
    W3bbo

    , itsnotabug wrote

    couldn't you just inherit the literal control and write your control in pure html and js?

     

    *edit** nevermind, looks like you're trying to add it to the toolbox. sorry, i've never done that ***

    Adding it to the toolbox just means adding the [ToolboxData] attribute, like so:

    [ToolboxData( "<{0}:Form runat=\"server\" />" )]
    public class MyFormSubclass : Form {
    }

  • User profile image
    itsnotabug

    , W3bbo wrote

    *snip*

    Adding it to the toolbox just means adding the [ToolboxData] attribute, like so:

    [ToolboxData( "<{0}:Form runat=\"server\" />" )]
    public class MyFormSubclass : Form {
    }

     

    that's good to know. i guess i never bothered to learn because you'd only really use this for redistribution. if i came up with a nifty control for a project, i'd more than likely create instances in code.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.