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.0Referencing Popup Calendar inside FormView - help neededReferencing Popup Calendar inside FormView - help needed
Previous
 
Next
New Post
1/29/2008 9:44 AM
 

I am trying to call DotNetNuke.Common.Utilities.Calendar.InvokePopupCal on a Calendar link I have setup in the EditTemplate of a FormView, using the following code in my .vb codebehind file:

            Dim tmpCalLink As HyperLink = FormView1.FindControl("cmdCalendar")
            Dim tmpDateOppStart As TextBox = FormView1.FindControl("DateOppStartTextBox")
            tmpCalLink.NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(tmpDateOppStart)

And in my .ascx file: (this falls within the EditTemplate of FormView1:

<asp:TextBox ID="DateOppStartTextBox" runat="server" Text='<%# Bind("DateOppStart") %>'></asp:TextBox>
        <asp:hyperlink id="cmdCalendar" resourcekey="Calendar" cssclass="CommandButton" runat="server">Calendar</asp:hyperlink>

I get the error:

  A critical error has occurred.
Object reference not set to an instance of an object.

And my Event Log shows:

AssemblyVersion: 04.05.05
PortalID: 0
PortalName: XXXXXXX DEV
UserID: 1
UserName: host
ActiveTabID: 93
ActiveTabName: Manage Vol Opps
RawURL: /default.aspx?tabid=93&id=119
AbsoluteURL: /default.aspx
AbsoluteURLReferrer: http://XXXXXXX/TestOrg/tabid/77/Default.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 95d4b4ab-0a07-4f24-bd1e-b013769f100d
InnerException: Object reference not set to an instance of an object.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: DotNetNuke.Common.Utilities.Calendar.InvokePopupCal
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(TextBox Field) at YourCompany.Modules.cn_VolOpps.Viewcn_VolOpps.Page_Load(Object sender, EventArgs e) in http://server//DesktopModules/cn_VolOppsForOrg/Viewcn_VolOpps.ascx.vb:line 22 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: SERVER3


where line 22 is (from above):

tmpCalLink.NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(tmpDateOppStart)

If I use it on a page that doesn't have the FormView, and reference the controls directly without the FormView1.FindControl, it works as expected. 

Can anyone provide some guidance?  Many thanks!

 

 
New Post
1/30/2008 3:20 AM
 

How if you change this code :

tmpCalLink.NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(tmpDateOppStart)

to this :

tmpCalLink.NavigateURL = CType(DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(tmpDateOppStart), String)

HTH.

 
New Post
1/30/2008 6:29 AM
 

Thanks, unfortunately that didn't work -- same error.

 
New Post
2/8/2008 8:34 PM
 

Templated controls in FormView are only created when you switch modes, so I suspect your code above is not able to find the control reference. Unfortunately FindControl does not seem to work in the change mode event either, so I ended up with below. Unfortunately now it is erroring out in the javascript call--any further help would be appreciated.

 

 

Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBoundSelect Case FormView1.CurrentModeCase FormViewMode.Edit, FormViewMode.InsertCType(FormView1.FindControl("cmdCalendar"), HyperLink).NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(CType(FormView1.FindControl("TaskDateTextBox"), TextBox))End Select

 

End Sub

 

 

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Referencing Popup Calendar inside FormView - help neededReferencing Popup Calendar inside FormView - help needed


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