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

  • SEARCH
  • Home
  • 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 4247688
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:08:34+00:00 2026-05-21T04:08:34+00:00

I have a user control with a property of type List<Something> : Private p_myList

  • 0

I have a user control with a property of type List<Something>:

Private p_myList As New List(Of Guid)
Public Property MyList() As List(Of Guid)
    Get
        Return p_myList
    End Get
    Set(ByVal value As List(Of Guid))
        If value Is Nothing Then Throw New ArgumentNullException()
        p_myList = value
    End Set
End Property

Is it popssible to set this property in the aspx source of the page using the UserControl, e.g., something like:

<uc1:myUserControl runat="server" MyList="3c7d794e-7645-46e7-bdde-a0bc42679261, 3c7d794e-7645-46e7-bdde-a0bc42679262" />

or do I need to create a “compatibility property” of type string which is then parsed? (I know that I could set these values through codebehind, but I’d prefer to do it in the aspx source.)

  • 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. Editorial Team
    Editorial Team
    2026-05-21T04:08:35+00:00Added an answer on May 21, 2026 at 4:08 am

    You need to create a TypeConvertor

    Something like

    public class GuidListTypeConverter : System.ComponentModel.TypeConverter 
    { 
        public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType) 
        { 
            return sourceType == typeof(Guid); 
        } 
        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<Guid> ret = new System.Collections.Generic.List<Guid>();
            foreach (string s in vals)
            {
                ret.Add(Guid.Parse(s));
            }
            return ret;
        } 
    }
    

    Then

    [TypeConverter(typeof(GuidListTypeConverter))]
    public List<Guid> MyList {get;set;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control that exposes a property of type ImageSource. I want
I have a property of type IEnumerable<SomeClassIWrote> in a user control. When I use
I have a user control and I want to create a property of type
I have a user control with a property defined as follows: public partial class
I have a user control from where I have to call the property of
I have an abstract user control(baseModule) that has a property that I plan on
I have created a user control (CheckedDirTree) that exposes a CheckedFolder property which in
I am creating a User Control where I have a property called Items. Items
Well..its working BUT only when user creates a property that is of type List.
I have an ascx user control with and Entity Framework IQueryable property like this:

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.