Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Custom Attributes(Check Box, Radio Button etc.) Problem
Last Post 12/11/2008 8:31 PM by Peter Donker. 4 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Gaurav Kumar
New Member
New Member
Posts:39


--
05/28/2008 3:05 PM

When we add another custom Control Like Checkbox,Radio Button then it create problem How can I add CheckBox Costom Control.
I tried to add CheckBox control which name is ChkDocumentVisibility12 then it give error. Error message is:

Http Parse Exception was caught

The base class includes the field 'ChkDocumentVisibility', but its type (System.Web.UI.WebControls.CheckBox) is not compatible with the type of control (System.Web.UI.WebControls.DropDownList).

on Reflection.vb page.

Can you provide me solution for add CheckBox custom control.

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
05/28/2008 10:36 PM
I'm not quite sure I follow. The ControlToLoad of the custom attribute is a checkbox?

Peter
Gaurav Kumar
New Member
New Member
Posts:39


--
05/29/2008 8:39 AM
I got it working. Thanks anyways.
Stuart Hilbert
New Member
New Member
Posts:39


--
12/10/2008 6:10 PM

Did you create a checkbox custom control?  I would love to get the code for it?  I am needing it for a project.

Thanks,
Stuart

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
12/11/2008 8:31 PM
Posted By Stuart Hilbert on 12/10/2008 18:10:05

Did you create a checkbox custom control?  I would love to get the code for it?  I am needing it for a project.

Imports DotNetNuke.Services.Localization.Localization

Imports Bring2mind.DNN.Modules.DMX.Business
Imports Bring2mind.DNN.Modules.DMX.Framework

Partial Public Class EditAmendments
 Inherits DMX.Framework.EntrySettingsBase

#Region " Private Members "
 Private _settings As AddonSettings
#End Region

#Region " Overrides "
 Public Overrides Sub LoadSettings()
  Dim ea As EntryAttributeInfo = EntryAttributesController.GetEntryAttribute(Me.EntryId, MyAppSettings.MyVariableAttributeId)
  If ea IsNot Nothing Then
   txtMyVar.Text = ea.Value
  End If
 End Sub

 Public Overrides Sub WriteToCurrentEntry(ByRef EntryToUpdate As DMX.Business.EntryInfo)

  Dim ea As New EntryAttributeInfo
  For Each ea In EntryToUpdate.CustomAttributes
   If ea.AttributeId = MyAppSettings.MyVariableAttributeId Then
    EntryToUpdate.CustomAttributes.Remove(ea)
   End If
  Next
  If txtMyVar.Text.Trim <> "" Then
   ea = New EntryAttributeInfo
   With ea
    .AttributeId = MyAppSettings.MyVariableAttributeId
    .EntryId = Me.EntryId
    .Value = txtMyVar.Text.Trim
   End With
   EntryToUpdate.CustomAttributes.Add(ea)
  End If

 End Sub

 Public Overrides Sub AfterSubmit(ByRef EntryBeingUpdated As DMX.Business.EntryInfo)

 End Sub
#End Region

#Region " Properties "
 Private ReadOnly Property MyAppSettings() As AddonSettings
  Get
   If _settings Is Nothing Then
    _settings = AddonSettings.GetSettings(PortalId)
   End If
   Return _settings
  End Get
 End Property
#End Region

End Class
You are not authorized to post a reply.