【发布时间】:2012-02-01 17:41:59
【问题描述】:
我有一个使用用户控件动态创建网页的网络应用程序。
在我的代码中,我有以下内容:
private void Render_Modules()
{
foreach (OnlineSystemPageCustom.OnlineSystemPageHdr.OnlineSystemPageModule item in custompage.Header.Modules)
{
if (item.ModuleCustomOrder != 99 && !item.ModuleOptional)
{
string typeName = item.ModuleInternetFile;
Type child = Type.GetType(typeName);
webonlinecustombase ctl = (webonlinecustombase)Page.LoadControl("../IPAM_Controls/webtemplatecontrols/" + child.Name.ToString() + ".ascx");
ctl.Event = Event;
ctl.custompage = custompage;
ctl.custommodule = item;
this.eventprogrammodules.Controls.Add(ctl);
}
}
}
正在返回的“typeName”(示例)是:
IPAMIntranet.IPAM_Controls.webtemplatecontrols.eventorgcommittee
用户控件的命名空间如下:
namespace IPAMIntranet.IPAM_Controls
我遇到的问题是 Type.GetType(typeName) 返回 null。我在这里错过了什么?
【问题讨论】:
-
是的对不起我的打字错误,我的意思是空
标签: c# asp.net web-applications user-controls gettype