2

I need an ASP.Net control on your property you can specify an array type string. That is, in my ASP.Net control would have something like:

DefaultValue("")> Category("Misc"), <Bindable(True),
Public Overridable Property MyProperty () As String ()
   Get
      Return mMyProperty
   End Get
   Set (ByVal value As String ())
     mMyProperty = value
   End Set
End Property

And from the ASP.Net page I need to pass the values​​, type:

<WC:MyControl MyProperty="1,2,4" runat="server" />

The message error is: Cannot create an object of type 'System.String[]' from its string representation '1,2,4' for the 'MyProperty' property.

Damián Herrera
  • 89
  • 2
  • 10

1 Answers1

5

You need to implement a TypeConvertor for this.

These resources could help you with it:

  1. How to: Implement a Type Converter
  2. Passing int list as a parameter to a web user control
  3. Passing int array as parameter in web user control
Community
  • 1
  • 1
Oleks
  • 31,955
  • 11
  • 77
  • 132