HttpException (0x80004005): Unable to generate code for a value of type....

K

KMILO

Hello Everyone,

Firts than all thank you for taking the time to read this (and understand my poor english), Im so needed of your help.


The problem is that im creating a basket control in c# for working in asp.net pages, the control do not make a postback for the items operations (adding,deleting, modifying, subtotals, etc) the control depends directly of the creation of three controls on the page that you putted into, a 1 htmlinputhidden, 1 htmlinputtext, 1 htmltable, (all of them running on server and created only one time, if you have the basket control into a datalist each of them must reference this set of controls) , in the first version of the control I ask the developer for the name of this controls and it works, the second version I was try to get the controls by the property grid of the page, referencing the type of each control directly like this:

private HtmlInputHidden _cajadetexto;
[Bindable(false),Category("Data"),PersistenceMode(PersistenceMode.InnerProperty),TypeConverter(typeof(System.Web.UI.HtmlControls.HtmlInputHidden))]
//,EditorAttribute(typeof(System.Web.UI.Design.HtmlControlDesigner), typeof(System.Web.UI.HtmlControls.HtmlInputHidden))]
public virtual HtmlInputHidden CajaDeTexto
{
get {return _cajadetexto;}
set {_cajadetexto = value;}
}

and implementing this way for all the other controls, I set the values in design time, and run time the following error appears:

Unable to generate code for a value of type 'System.Web.UI.HtmlControls.HtmlInputHidden'. This error occurred while trying to generate the property value for CajaDeTexto.

I think that the typeconverter causes the problem, but im not sure of this.

Thanks In Advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top