Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 49813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:29:44+00:00 2026-05-10T16:29:44+00:00

I have an int array as a property of a Web User Control. I’d

  • 0

I have an int array as a property of a Web User Control. I’d like to set that property inline if possible using the following syntax:

<uc1:mycontrol runat='server' myintarray='1,2,3' /> 

This will fail at runtime because it will be expecting an actual int array, but a string is being passed instead. I can make myintarray a string and parse it in the setter, but I was wondering if there was a more elegant solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:29:44+00:00Added an answer on May 10, 2026 at 4:29 pm

    Implement a type converter, here is one, warning : quick&dirty, not for production use, etc :

    public class IntArrayConverter : System.ComponentModel.TypeConverter {     public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType)     {         return sourceType == typeof(string);     }     public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)     {         string val = value as string;         string[] vals = val.Split(',');         System.Collections.Generic.List<int> ints = new System.Collections.Generic.List<int>();         foreach (string s in vals)             ints.Add(Convert.ToInt32(s));         return ints.ToArray();     } } 

    and tag the property of your control :

    private int[] ints; [TypeConverter(typeof(IntsConverter))] public int[] Ints {     get { return this.ints; }     set { this.ints = value; } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array in the form of ' int[][] ' that represents the
When you have an array like this: int foo[3][2][2]; and you make: int *bar
I have a byte array property that must be a certain length. I am
I have a class that creates a static array of all properties, using a
I have a large int[] array and a much smaller int[] array. I want
I have an array of integers: int[] number = new int[] { 2,3,6,7 };
Lets say I have this array, int[] numbers = {1, 3, 4, 9, 2};
I have the following Int lists: t1 = [1000, 1001, 1002, 1003, 1004] t2
I have to work with multiple SQL Server tables that generally look like this:
I have an NSObject that I am using to store/hold properties of an object,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.