Last post Aug 15, 2010 01:28 AM by jkirkerx
Aug 13, 2010 06:53 AM|NeCroFire|LINK
I have created a custom control from scratch and it works fine as in you can build the project that uses it and it works fine at runtime. Problem is when you go to design view the control shows an error in the place of where the control should be rendered.
Error: '<SomeValue>' Could not be set to '<SomeProperty>'
This shows up on all my custom set properties. These properties are created as basic as possible. I can give the properties values in Source view and run the app just fine. I can even add a Onclick event. If I don't set any custom properties the control
will render fine in Design view. It's only when I set a value to a custom property.
Property Code Example:
public string Text
string ret = "";
object obj = ViewState["Text"];
if (obj != null)
ret = obj.ToString();
ViewState["Text"] = value;
I've even removed the Category and Description tags with no difference.
I don't know if what I said makes sens, but I hope it does.
Thanks in advance.
Aug 13, 2010 07:54 AM|tyrone1964|LINK
If its a composite custom control you'll need to render the control collection in the overriden render method or use a class that implements ITemplate to view it in the designer, not just add the controls to the control collection.
If I don't want to take full control of the render on the browser I do this:
protected override Render(HtmlTextWriter writer)
//Render for designer
Aug 13, 2010 08:07 AM|NeCroFire|LINK
That's interesting. I'll take a look.
I was just about to give up on Google when I found this:
It worked for me, but I'm sure it will happen again at some point.
EDIT: Right at the bottom there are links to the hotfix. Looks like it's an error that is caused by the SP1 update.
Quoted from above link:
Please note that there are actually two hotfixes released, as described on: http://support.microsoft.com/kb/961847
One is for Windows XP and 2009, while the other is for Windows Vista and Windows Server 2008.
Windows XP and 2003:
Windows Vista and Windows Server 2008:
Aug 15, 2010 01:28 AM|jkirkerx|LINK
I see that come and go. I know setting the default value of a property will trigger that, but you did not set that.
My installation is doing that now, I had to reinstall windows and reload all my programs. Ther are some really small updates to VS 2008 that fixes it. Could not tell you which one. One of them fixes the hyperlink when using images, might want to google hyperlink