Results 1 to 5 of 5

Thread: ASCX Control Properties

  1. #1

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    ASCX Control Properties

    Is there a way to show the control properties in the property dialog when the control is selected? Currently if you select the control it only shows things like EnableViewState and Visible. I can set properties in the HTML declaration of the control but it'd be nice to see them in the IDE. Or is it not meant to work like that?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Here is what I have found so far....
    http://www.codenotes.com/do/articles...?articleID=775
    of course, the ms site....
    http://msdn.microsoft.com/library/de...erControls.asp

    This page though, seems to have what you need.
    http://www.c-sharpcorner.com/Code/20...nedCompDev.asp

    Hope you know C#...
    Last edited by hellswraith; May 13th, 2003 at 10:17 AM.

  3. #3

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    So it looks like you can't do what I was thinking. Oh well doing it through HTML or Code is fine. Thanks.

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Did you see this part?
    Code:
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.ComponentModel;
     
    [ assembly:TagPrefix("CommonControls", "CC") ]
    namespace CommonControls
    {
    [DefaultProperty(“myProperty”)]
    public class myControl : System.Web.UI.WebControls.WebControl
    { 
    private 
    public override myControl():base()
    {
     
    }
    [Bindable(true), Category("Appearance")] 
    public string myPorperty
    {
    get 
    {
    return _CSSComplete;
    }
    set 
    {
    _CSSComplete = value;
    }
    }
     
    protected override void Render(HtmlTextWriter output)
    {
    output.write(myProperty);
    }
    }
    }
    There is a single property myProperty, which is both read & write. It is declared with three of the above-mentioned attributes. Any number of properties could be added to the class & could be accessed from the toolbox of Visual Studio.
    I thought that was what your looking for....
    from this link: http://www.c-sharpcorner.com/Code/20...nedCompDev.asp

  5. #5

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Yeah I saw that but that is for Custom Controls instead of User Controls right? I didn't try it though to make sure, because I only have one property and was hoping that there was just a simple solution. Maybe I'll try converting it to a Custom Control. Does a Custom control work just like a User control? Can I still access the Page_Load event of the host?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width