Last post Apr 26, 2005 10:01 AM by arnolddustin
Apr 25, 2005 03:32 PM|dot_net_boy|LINK
Hello, can you help- I can't create a DNN calendar programatically!! Here's the code - The error is NullReferenceException when I call Common.Utilities.Cakendar.InvokePopupCal(txt)... Any ideas ???????????
Dim txt As New TextBox
txt.ID = "date_1"
Dim hyp As New HyperLink
hyp.ID = "hyp_1"
hyp.Text = "Calendar"
hyp.NavigateUrl = Common.Utilities.Calendar.InvokePopupCal(txt)
hyp.CssClass = "CommandButton"
Apr 25, 2005 05:14 PM|arnolddustin|LINK
In your code, it doesn't appear that the controls are actually added to the page/control. ASP.NET won't render them unless you put them into a container somewhere. Try this:
If you need these controls to be dynamically created you should consider moving this code into the Init method of your control in case you need postback data to be persisted.
Apr 26, 2005 02:46 AM|dot_net_boy|LINK
Apr 26, 2005 10:01 AM|arnolddustin|LINK
I haven't used InvokePopupCal on dynamically created controls, so I'm not sure if that's the issue or not.
If I find anything I'll post it here.