Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help with Page_loadHelp with Page_load
Previous
 
Next
New Post
7/24/2006 9:33 PM
 

I writing my first module and I have been able to follow most of the tutorials on the web.  This module follows the model described on Adefwebserver, using ObjectDataSource controls to connect the presentation layer and the BLL(OvertimeController).  Anything I try to do in the Page_Load Event causes NullReferenceException.

"Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at PSLPD.Modules.OverTime.ViewOverTime.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace"

The patricular piece of code that is causing the error now is:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Try

Dim objModules As ModuleController = New ModuleController

'Sets ShiftIsFilledMessage to False until raised by the DetailsView1_ItemUpdating

ShiftIsFilledMessage.Visible = False

Catch ex As Exception

Exceptions.ProcessModuleLoadException(Me, ex)

End Try

End Sub

If I rem out the line in red everything works, except the label is visible.  I had the same problem trying to load a popup calendar in the Page_Load.  The label is declared in the #Controls Section:

Protected WithEvents ShiftIsFilledMessage As System.Web.UI.WebControls.Label

Does anyone have any idea what I'm missing, the same page works great outside of DNN.

John

 


John
 
New Post
7/25/2006 5:58 AM
 

Is your module control inherited on PortalModuleBase?

Did you check your .Designer file if the control was added correctly there?

Can you paste also how is your control added to the ascx part of the control?

 


Thanks,
Vladan Strigo
NETMedia

My website: Vladan.Strigo.NET

Vladan.Strigo.NET: Projects
* Advanced VS2005 development approach - BlankModule
* DNN & Microsoft Ajax best practices guidance

Vladan.Strigo.NET: Resources
* Comprehensive list of DNN 4 Module development resources

 
New Post
7/25/2006 11:13 AM
 

Vladan, Thanks for the help.  I'm new to Dnn Modules and this really has me stumped.  I believe I have inhertited the PortalModuleBase correctly.

Imports DotNetNuke

Imports System.Web.UI

Imports System.Web.UI.WebControls

Imports System.Collections.Generic

Imports System.Globalization

Imports System.Text

Imports System.Reflection

Imports DotNetNuke.Entities.Modules

Namespace PSLPD.Modules.OverTime

Partial Class ViewOverTime

Inherits DotNetNuke.Entities.Modules.PortalModuleBase

Implements DotNetNuke.Entities.Modules.IActionable

I am not sure what you are talking about with the .designer file, where would I find that?

Here is the control from the ascx page.

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4"

DataSourceID="ObjectDataSource_OTDetail" DataKeyNames="ID" ForeColor="#333333" GridLines="None"

Height="50px" Width="125px" BorderColor="Gray" BorderStyle="Ridge">

<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />

<EditRowStyle BackColor="#999999" />

<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />

<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />

<Fields>

<asp:BoundField Fields Omitted to shorten Message

<asp:CommandField ShowEditButton="True" EditText="Sign-Up" />

</Fields>

<FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />

<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<HeaderTemplate>

You have Selected to Sign-Up for...

</HeaderTemplate>

<AlternatingRowStyle BackColor="White" ForeColor="#284775" />

<FooterTemplate>

<asp:Label ID="ShiftIsFilledMessage" runat="server" BackColor="Yellow" BorderColor="Red"

BorderStyle="Ridge" EnableViewState="False" Font-Bold="True" ForeColor="Red"

Text="This Shift is Already Filled!" ToolTip="The Shift is Filled, Select Another Shift from the OT Board." Visible="True"></asp:Label>

</FooterTemplate>

</asp:DetailsView>

 The ShiftIsFilledMessage Label is in the FooterTemplate and I want to hide it on Page_Load and have only visible if a condition is met during the DetailsView1_ItemUpdating method.

Any help is greatly appreciated.

John


John
 
New Post
7/25/2006 12:22 PM
 

you are doing something horribly wrong, wich would take me alot of time to explain why you are doing it wrong, and to be honest I don't feel like explaining it all. but I do have some advice:

 

I would get rid of the footer template and just put the label below/outside the detailsview

This will make your idea work

 

even better, instead of using an errorlabel, use this:

DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, myMessage, ModuleMessageType.YellowWarning)


Edit your Skin.xml and Container.xml files with:
Yannick's SXE
 
New Post
7/25/2006 6:03 PM
 

Purplebox,

Thanks for the help, both ideas worked.  I'll keep investigating why the label won't work in the footer template, and that might help me understand why the pop-up calendar in a formview is giving me the same problem.


John
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help with Page_loadHelp with Page_load


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out