473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Need help from designer experts: templated control

AW
Hello guys, it's my turn to ask for help,

I'm fighting with Visual Studio.net 2003. I made a templated control and it
displays alright when I ask the page through my browser, but Visual Studio
can't display it. It displays the usual grey rectangle with an exclamation
mark saying " '' could not be set on property 'Columns'. "

I suspect that I missed a property, but can't manage to see which one. If
anybody could help me, that would be great.

Here is the simplified code for reference.

ASPX page that uses the control:
<%@ Register TagPrefix="cc1" Namespace="Controls" Assembly="Controls" %>
....
<cc1:MyControl id="MyControl12" runat="server">
<Columns>
<cc1:Column Name="Toto" Type="A" />
<cc1:Column Name="Titi" Type="B" />
</Columns>
</cc1:MyControl>

Control and its classes:
public class MyControl : WebControl
{
private ColumnCollection m_columns ;

public MyControl()
{
m_columns = new ColumnCollection() ;
}

[PersistenceMode(PersistenceMode.InnerProperty)]
public ColumnCollection Columns
{
get { return m_columns ; }
set { m_columns = value ; }
}

protected override void Render(HtmlTextWriter writer)
{
writer.Write("<b>Hello, the columns are:<b>");
writer.Write("<ul>");
foreach(Column c in Columns)
{
writer.Write("<li>");
writer.Write(c.Name);
}
writer.Write("</ul>");
}

}

public class ColumnCollection : CollectionBase, IList, ICollection
{
public ColumnCollection() : base( )
{

}

public void Add(Column _col)
{
List.Add(_col);
}

[NotifyParentProperty(true)]
public Column this[int index]
{
get { return List[index] as Column ; }
set { List[index] = value ; }
}

}
public class Column
{
private string m_name ;
private string m_type ;

[Category("Data"),
PersistenceMode(PersistenceMode.Attribute)]
public string Name
{
get { return m_name ; }
set { m_name = value ; }
}

[Category("Data"),
PersistenceMode(PersistenceMode.Attribute)]
public string Type
{
set { m_type = value ; }
get { return m_type ; }
}

public override string ToString()
{
return m_name + "/" + m_type;
}

}

--
To reply, remove a "l" before the @ sign.

Arnaud Weil - MCT, MCSD.Net, MCAD.Net
Nov 17 '05 #1
0 863

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ricky Li | last post by:
I went through some article to see how I can add schema validation for my templated control by adding an XSD file into the VS.NET schema folder. Everything works fine for a schema like this: ...
2
by: Earl Teigrob | last post by:
I have created a simple custom control that uses a table to create space around its contents. The code in the aspx page is show below. My problem is that the controls within the template can not be...
0
by: Earl Teigrob | last post by:
I have created a templated custom control that simply creates a spacing table around other objects. This control works fine for most uses but when I add it inside the ItemTemplate of a DataGrid...
1
by: Hasani \(remove nospam\) | last post by:
The way the system works is, you create a user control (ascx) that will be a template and must implement the interface IPageTemplate. You then create one or more user controls (ascx) that implement...
22
by: Howard Kaikow | last post by:
There's a significant problem in automating Excel from VB .NET. Reminds me of a problem I encountered almost 3 years ago that was caused by the Norton Auntie Virus Office plug-in. Can anybody...
8
by: Joey Chömpff | last post by:
L.S., Hello is there a way to implement 2-way databinding without using the datasources from dotnet 2.0. Why would you ask? Now that's simple. I've created an object model with BusinessObjects...
2
by: rmandel | last post by:
I'm very, very new to .Net but have been doing C/C++ for years. I'm having a great deal of difficulty with something that should be simple. Here's what I'm trying to do.... Display three...
21
by: T.A. | last post by:
I understand why it is not safe to inherit from STL containers, but I have found (in SGI STL documentation) that for example bidirectional_iterator class can be used to create your own iterator...
10
by: David Thielen | last post by:
Hi; I have help html pages for each page of my ASP.NET webapp. So for the page datasource.aspx, I have help\datasource.htm. Bu what I want when the hyperlink is clicked, for it to look for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.