Click to See Complete Forum and Search --> : ASCX Control Properties
Edneeis
May 13th, 2003, 12:56 AM
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?
hellswraith
May 13th, 2003, 10:13 AM
Here is what I have found so far....
http://www.codenotes.com/do/articles/article?articleID=775
of course, the ms site....
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriWebUserControls.asp
This page though, seems to have what you need.
http://www.c-sharpcorner.com/Code/2002/May/UserDefinedCompDev.asp
Hope you know C#...
Edneeis
May 13th, 2003, 10:49 AM
So it looks like you can't do what I was thinking. Oh well doing it through HTML or Code is fine. Thanks.
hellswraith
May 13th, 2003, 01:32 PM
Did you see this part?
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/2002/May/UserDefinedCompDev.asp
Edneeis
May 13th, 2003, 02:07 PM
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?
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.