Hidden Field and preset Value causes error

  1. #1

    Hidden Field and preset Value causes error

    Hi guys,

    have the following code in my asp.net (dotNet 4.0) page:

    <ext:Hidden ID="field_Hidden" runat="server" Value="anyValue" />
    and get that Error in the Browser:

    Parser Error Message: Cannot create an object of type 'System.Object' from its string representation 'anyValue' for the 'Value' property.
    It should be possible to set an initial value within the tags.

    Best regards,

    Frank
    Last edited by geoffrey.mcgill; Jan 27, 2012 at 2:38 AM. Reason: please use [CODE] tags
  2. #2
    Please use the .Text property, instead of .Value.

    As well, please ensure you wrap your code samples in [CODE] tags.

    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3

    Solved

    Thanks mate,

    that helped. Sorry for forgetting the Code Tags.
    But I'm still wondering why the VALUE attribut is an object.

    Frank
  4. #4
    Quote Originally Posted by Bubu View Post
    But I'm still wondering why the VALUE attribut is an object.
    .Value is an Object because it's a common property of the parent Field type. Within each child type of Field (such as TextField, NumberField, etc) the .Value is treated differently. Some cases it's String, others an Int32, DateTime, Boolean, etc.

    .Value is a common property, and what value is actually being held in .Value differs depending on the Field type.

    The ASP.NET Parser cannot properly parse .Value properties if configured in markup. The .Value property shouldn't actually show up in markup Intellisense, so I'll double check that it isn't, and fix if it is.
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Hidden field affects layout, why?
    By CarpFisher in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: May 10, 2012, 2:25 PM
  2. [2.0 Beta 2] nCannot access Hidden field
    By Alexx in forum 2.x Help
    Replies: 2
    Last Post: May 03, 2012, 9:31 AM
  3. [CLOSED] Problems with Hidden Field after SVN Update
    By macap in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: May 23, 2011, 11:12 AM
  4. [CLOSED] Hidden field problem
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 12, 2008, 1:39 PM
  5. [CLOSED] Hidden field question
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 12, 2008, 9:18 AM

Posting Permissions