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.

1 Answer 1

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
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.