473,772 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error creating control: ID property is not specified

I get the error "Error creating control: ID property is not specified" when
I view my custom web control in design view.
I add the control that gives an error in OnInit like this:
-----
foreach (WizardStep ws in WizardSteps)
{
CustomWizardSte pHeader header = new CustomWizardSte pHeader();
header.ID = "CustomWizardSt epHeader";
ws.Controls.Add At(0, header);
}
-----
So I have specified the ID, why do I get the error then?

Kind Regards,
Allan Ebdrup
Jul 13 '07 #1
3 4015
"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:sO******** ********@TK2MSF TNGHUB02.phx.gb l...
Hi Allan,

Is your custom web control a User Control or a Server Control? I assume
you're creating a custom Server Control which inherits from the Wizard
control.
Yes it's a server control.
When you use this customer Server Control on a Web Form, you will
also need to assign the ID property for it. For example:
<snip>

There is an ID assigned to the tag, and everything runs fine when I run the
page, the problem only occurs in design view.
I've added IDs to all the controls that are generated programatically and
now I get a different error (again only in design view not when I run the
page)
On the Child Control I've added a "CustomWiza rd" property in whitch I set
the Wizard control that the Child is a Child of (the header knows what
wizard it's part of).
Now I get the following error in design view:

"Cannot create an object of type 'CustomWizard' from its string
representation 'CustomWizard1' for the CustomWizard Property."

I guess it's because of some kind of serialization or something so I've
added the following attributes to tha CustomWizard property in the child
control:

[System.Componen tModel.Browsabl e(false)]
[System.Componen tModel.EditorBr owsable(System. ComponentModel. EditorBrowsable State.Never)]
[System.Componen tModel.Designer SerializationVi sibility(System .ComponentModel .DesignerSerial izationVisibili ty.Hidden)]

But that didn't solve the problem.

Can't you add properties to controls and only use them programatically ? What
am I missing?

Kind Regards,
Allan Ebdrup
--
Try a beta of my free Survey solution that makes heavy use of AJAX at
http://obsurvey.com, feedback is very welcome.
Jul 16 '07 #2
I've tried adding a typeconverter:
----------------
public class PageControlType Converter<TCont rol: TypeConverter where
TControl : Control
{
// Overrides the CanConvertFrom method of TypeConverter.
// The ITypeDescriptor Context interface provides the context for the
// conversion. Typically, this interface is used at design time to
// provide information about the design-time container.
public override bool CanConvertFrom( ITypeDescriptor Context context,
Type sourceType)
{
if (sourceType == typeof(string))
{
return true;
}
return base.CanConvert From(context, sourceType);
}
// Overrides the ConvertFrom method of TypeConverter.
public override object ConvertFrom(ITy peDescriptorCon text context,
CultureInfo culture, object value)
{
if (value is string)
{
Page page = (Page)HttpConte xt.Current.Hand ler;
TControl c = page.FindContro l((string)value ) as TControl;
return c;
}
return base.ConvertFro m(context, culture, value);
}
// Overrides the ConvertTo method of TypeConverter.
public override object ConvertTo(IType DescriptorConte xt context,
CultureInfo culture, object value, Type destinationType )
{
if (destinationTyp e == typeof(string))
{
return ((TControl)valu e).ID;
}
return base.ConvertTo( context, culture, value, destinationType );
}
}
----------------
And adding this attribute to the child controls property:
[TypeConverter(t ypeof(PageContr olTypeConverter <CustomWizard>) )]

But I still get the same error in design view...

Jul 16 '07 #3
Hi Allan,

I'm not sure if this is caused by the TypeConverter or not. I cannot tell
clearly what might be the cause without reproducing the issue on my side
and see the detailed error messages. Could you please create a reproducible
project and send it to me? Thank you for the trouble.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 17 '07 #4

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

Similar topics

5
16259
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager."
6
4753
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
7
5024
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version, which I did, then reran WebSetup.msi and keeps giving me this error. "The installer was interrupted...
8
9469
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
5
5141
by: Nathan Sokalski | last post by:
When running a page I am working on, I recieve the following error: Cannot use a leading .. to exit above the top directory. I suspect this has something to do with the problem I posted in a recent posting "HyperLink.NavigateUrl always adds an extra ../ when going to a higher level directory" on Sunday, May 29, 2005 7:33 PM However, I cannot be sure because I cannot view the generated code since it gives the error before anything is...
2
4924
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is being updated by some other process through remoting. When the page loads, I init the tree, and in my browser I can see the initialized tree. The problem is that every time that I receive update to tree from the remote process,
2
6288
by: c676228 | last post by:
Hi, I have several user controls like email, phone,ssn etc. each has it's own validation message in its user control already. When I bring all those user controls in an aspx page, I would like to display a summary error messages using validation summary in an aspx page, how to do that? Thank you. -- Betty
0
23511
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub) 5: Procedure call or argument is not valid. 6: Overflow. 7: Out of memory.
1
3539
by: Allan Ebdrup | last post by:
I have a asp.net v2 website that runs fine on our development server. I have published the website to a stage server and it runs fine, but when I publish it to production I get the following error: The type specified in the TypeName property of ObjectDataSource 'PositionPostingsDataSource' could not be found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.