【发布时间】:2008-10-06 14:42:59
【问题描述】:
我的一个 aspx 页面中有以下代码:
<% foreach (Dependency dep in this.Common.GetDependencies(this.Request.QueryString["Name"]))
{ %>
<ctl:DependencyEditor DependencyKey='<%= dep.Key %>' runat="server" />
<% } %>
当我运行它时,我收到以下错误:
解析器错误消息:无法从“DependencyKey”属性的字符串表示“”创建类型为“System.Guid”的对象。
有什么方法可以创建控件并在 aspx 页面中传递 Guid?我真的很讨厌不得不循环并在后面的代码中创建这些控件只是因为那个......
注意:Dependency 对象上的 Key 属性是一个 Guid。
【问题讨论】: