Help needed for "generic" System.Object Converter

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Help needed for "generic" System.Object Converter

    Hi, I have custom web server control with one property being of type
    System.Object.

    At design time, only string values are allowed to be entered in the property
    window. If "StringConverter" is used for the TypeConverter attribute, a user
    can enter string values for this property and those values get serialized to
    the aspx.

    However, at run time an exception gets raised (as StringConverter can only
    convert to a string, not from a string).

    The question is: how to build a custom type converter for the generic
    System.Object type/class? I guess this should inherit from StringConverter
    but am unsure how to code the ConvertTo and CanConvertTo methods?


    ~ Gajba





    microsoft.newsgroups.com Guest

  2. Similar Questions and Discussions

    1. Can't locate object method "newFromJpeg" via package "GD::Image"
      Hi. I'm trying to execute this Perl simple script: -------- #!/usr/bin/perl use GD; my $srcimage = GD::Image->newFromJpeg("image_news.jpg");...
    2. Can't locate object method "blocking" via package "IO::Handle"
      I am receiving the error message: Can't locate object method "blocking" via package "IO::Handle" at...
    3. Cannot access a disposed object named "System.Net.TlsStream"???
      Hi, When I trying to do HTTP POST to HTTPS URL I am getting this error on first attempt: Cannot access a disposed object named...
    4. Can't not locate object method "isadmin" via package "Noc1"
      Hello all, I just added a new method called isadmin to existing and working module Noc1.pm And use this new added method in my index.html...
    5. Lsass.exe System error "object name not found". System keeps rebooting
      When trying to install the drivers for the PCI modem in my laptop, prompted for the driver CD. Installed the driver without any errors but asked...
  3. #2

    Default Re: Help needed for "generic" System.Object Converter

    On Wed, 21 Sep 2005 19:02:17 +0200, microsoft.newsgroups.com wrote:
    > Hi, I have custom web server control with one property being of type
    > System.Object.
    >
    > At design time, only string values are allowed to be entered in the property
    > window. If "StringConverter" is used for the TypeConverter attribute, a user
    > can enter string values for this property and those values get serialized to
    > the aspx.
    >
    > However, at run time an exception gets raised (as StringConverter can only
    > convert to a string, not from a string).
    >
    > The question is: how to build a custom type converter for the generic
    > System.Object type/class? I guess this should inherit from StringConverter
    > but am unsure how to code the ConvertTo and CanConvertTo methods?
    >
    >
    > ~ Gajba
    I think that you are pointing in the correct direction. You can use
    reflection to find out the 'from' type.

    intrader Guest

  4. #3

    Default Re: Help needed for "generic" System.Object Converter


    "intrader" <intrader@aol.com> wrote in message
    news:pan.2005.09.21.22.54.53.903145@aol.com...
    > I think that you are pointing in the correct direction. You can use
    > reflection to find out the 'from' type.
    And this is exactly where I stuck ;)

    Thanks.


    Zarko Gajic Guest

  5. #4

    Default Re: Help needed for "generic" System.Object Converter

    On Thu, 22 Sep 2005 09:42:53 +0200, Zarko Gajic wrote:
    >
    > "intrader" <intrader@aol.com> wrote in message
    > news:pan.2005.09.21.22.54.53.903145@aol.com...
    >
    >> I think that you are pointing in the correct direction. You can use
    >> reflection to find out the 'from' type.
    >
    > And this is exactly where I stuck ;)
    >
    > Thanks.
    Sorry, you can check [url]http://odetocode.com/Articles/288.aspx[/url]

    The method is GetType.



    intrader Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139