Hello Friends,
i downloaded Asp.net portal starter kit 1.1 and then i downloaded aspnetportal-install-May042008 and tried very hard to add some modules and upgrade to it..finally i succeeded with it. I wanted to use it as i wanted to have master page support..
Finally i m getting run time erro in desktopdefault.aspx : System.NullReferenceException: Object reference not set to an instance of an object.
This error occurs in page_load event of desktopdefault.aspx page..below is my code where i am getting error.
protected void Page_Init(object sender, EventArgs e) {
PortalSettings portalSettings = (PortalSettings) HttpContext.Current.Items["PortalSettings"];
if (PortalSecurity.IsInRoles(portalSettings.ActiveTab.AuthorizedRoles) == false) {
Response.Redirect("~/Admin/AccessDenied.aspx");
}
if ((Request.IsAuthenticated == false) && (portalSettings.ActiveTab.TabIndex == 0)) {
LeftPane.Controls.Add(Page.LoadControl("~/DesktopModules/SignIn.ascx"));
LeftPane.Visible = true;
}
if (portalSettings.ActiveTab.Modules.Count > 0) {
foreach (ModuleSettings _moduleSettings in portalSettings.ActiveTab.Modules) {
Control parent = Page.FindControl(_moduleSettings.PaneName);
try
{
if (( _moduleSettings.CacheTime ) == 0)
{
PortalModuleControl portalModule = (PortalModuleControl) Page.LoadControl(_moduleSettings.DesktopSrc);
portalModule.PortalId = portalSettings.PortalId;
portalModule.ModuleConfiguration = _moduleSettings;
parent.Controls.Add( portalModule); // i am getting error here..
}
else
{
CachedPortalModuleControl portalModule = new CachedPortalModuleControl( );
portalModule.PortalId = portalSettings.PortalId;
portalModule.ModuleConfiguration = _moduleSettings;
parent.Controls.Add(portalModule);
}
}
catch (Exception en)
{
throw en;
}
parent.Controls.Add(new LiteralControl("<" + "br" + ">"));
parent.Visible = true;
}
}
}
I really want to solve this error and wana get back to work..pls help...
Regards,
Nil
Regards,
Nil
Please MARK POST AS AN ANSWER if it helps you
My Blog
![]() |
0 |
![]() |
Hiya,
Try setting a breakpoint on the problem code and see what you get out of the debugger. from the error it looks like you are trying to add a null object.
Cheers
Jorus.
--Please put "Mark as Answer" if I help you solve your problem, Thanks.
![]() |
0 |
![]() |
Hi,
I did everything but i am not getting where is the problem as every module is loaded in desktopdefault.aspx at runtime..it really becomes very difficult to trace to the root where problem really occurs..
I am still waiting for some solution..any help will be appreciated...Thanks a lot for replying me..
Regards,
Nil
Regards,
Nil
Please MARK POST AS AN ANSWER if it helps you
My Blog
![]() |
0 |
![]() |
can anyone guide me on this?
Regards,
Nil
Please MARK POST AS AN ANSWER if it helps you
My Blog
![]() |
0 |
![]() |
Finally i put this thing aside and started with new one..
Thanks,
Nil
Regards,
Nil
Please MARK POST AS AN ANSWER if it helps you
My Blog
![]() |
0 |
![]() |