Hi,
I am trying to create a custom control..something very simple with just a textbox. I followed the instructions you provided in another topic here but I am running into some problems. I can view the custom control on the custom attributes page, but when I click on the NEXT button, I see the message
Value cannot be null. Parameter name: key
This is all I have added in the controls code in WriteToCurrentEntry function
Dim
bExists As Boolean
Dim att As AttributeInfo = AttributesController.FindAttributeByName("SimpleControl", PortalId)For Each eatt As EntryAttributeInfo In EntryToUpdate.CustomAttributesIf eatt.AttributeId = att.AttributeId Then
eatt.Value = txtSimple.Text
bExists =
True
End If
Next
If Not bExists Then
.AttributeId = att.AttributeId
.EntryId =
.Value = txtSimple.Text
Dim eatt As New EntryAttributeInfoWith eattMe.EntryIdEnd With
EntryToUpdate.CustomAttributes.Add(eatt)
End If
Why is this happening. Please help or could someone post the instructions or code for creating a simple custom control.
When I debug, this is what I get
System.ArgumentNullException was caught
Message="Value cannot be null. Parameter name: key"
ParamName="key"
Source="mscorlib"
StackTrace:
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Bring2mind.DNN.Modules.DMX.Business.EntryAttributesCollection.Add(EntryAttributeInfo value) at Bring2mind.DNN.Modules.DMX.SimpleControl.WriteToCurrentEntry(EntryInfo& EntryToUpdate) in C:\Documents and Settings\george_a.SUBWAYDAI\My Documents\DOCS\DMX\DMX 5\Resources\Controls\SimpleControl.ascx.vb:line 33 at Bring2mind.DNN.Modules.DMX.Controls.WebControls.CustomAttributes.WriteToCurrentEntry(EntryInfo& EntryToUpdate) at Bring2mind.DNN.Modules.DMX.Controls.EditEntry.HandleWizardStep(Control StepContent) in C:\Documents and Settings\george_a.SUBWAYDAI\My Documents\DOCS\DMX\DMX 5\Resources\EditEntry.ascx.vb:line 338 at Bring2mind.DNN.Modules.DMX.Controls.EditEntry.ChangePage(Object sender, WizardNavigationEventArgs e) in C:\Documents and Settings\george_a.SUBWAYDAI\My Documents\DOCS\DMX\DMX 5\Resources\EditEntry.ascx.vb:line 243
InnerException:
I have already spent a lot of time to figure this out and it would be really helpful if there was some documentation on this.
Thanks