|
-
May 13th, 2003, 12:56 AM
#1
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?
-
May 13th, 2003, 10:13 AM
#2
PowerPoster
Last edited by hellswraith; May 13th, 2003 at 10:17 AM.
-
May 13th, 2003, 10:49 AM
#3
So it looks like you can't do what I was thinking. Oh well doing it through HTML or Code is fine. Thanks.
-
May 13th, 2003, 01:32 PM
#4
PowerPoster
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
-
May 13th, 2003, 02:07 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|