从字符串"System.Int32"创建System.Type时出错. [英] Error creating System.Type from string "System.Int32"

查看:136
本文介绍了从字符串"System.Int32"创建System.Type时出错.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我昨晚发布(预编译)的网站上,出现以下错误.在进行预编译之前,我收到一个编译器错误,即未找到用户控件.在另一台机器上编译并运行后,出现以下解析器错误:

On a web site I published (pre-compiled) last night, I get the following error. Before pre-compiling it, I was getting a compiler error that a User Control was not found. After compiling on another machine, and running, I get the following Parser error:

"Cannot create an object of type 'System.Type' from its srting representation 'System.Int32' for the 'DataType' property"

是我现在遇到的运行时解析器错误.令人讨厌的标签是telerik:RadNumericTextBox .... DataType ="System.Int32" ...

was the, now runtime, parser error I got. The offending tag is telerik:RadNumericTextBox .... DataType="System.Int32"...

我再次强调,此错误仅在XP SP2上发生,而不在Vista和Win7上发生.我打算在Telerik进行一些Google搜索,并发布日志记录.

I emphasise again that this error only occurs on XP SP2, not on Vista and Win7. I'm off to do some Googling and issue logging at Telerik.

推荐答案

此问题的根源不仅仅是Telerik,而且ASP.NET无法解释字符串表示形式.我只是在一个没有Telerik的小型测试项目上尝试了此操作,但遇到了同样的错误.

The base of this problem isn't just Telerik, but ASP.NET not being able to interpret the string representation. I just tried this on a small test project, with no Telerik, and I get the same error.

这并不是说还没有解决它,但是我对他们的工作方式印象深刻.只需使用两个属性即可轻松完成此操作,一个属性需要一个字符串并从中获取一个类型,然后设置实际的type属性,但这会变得很混乱.

This is not to say the haven't fixed it, but I would be impressed to see how they did. It is easily done with two properties, one that takes a string and gets a type from it, and sets the actual type property, but that gets messy.

这篇关于从字符串"System.Int32"创建System.Type时出错.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆