Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kasun 8 posts 77 karma points
    May 12, 2016 @ 12:41
    Kasun
    0

    Bracket syntax for dynamic property

    Hi,

    I have a Form which contains a hidden field. I want to set a property to it's default value as, the Current page's (where the form is) dynamically generated property.

    @{
        var umbNode = new umbraco.presentation.nodeFactory.Node(Convert.ToInt32(Umbraco.Field("selectOrganization").ToString()));
        string propValue = umbNode.GetProperty("orgName").Value;      
     }
    

    I am able to set a value which is in the Document type properties (using [#alias] syntax)

    but I can't set the "propValue" to the hidden field default value..

    appriciate your help on this..

    thanks

  • Manish 373 posts 932 karma points
    May 12, 2016 @ 12:58
    Manish
    0

    Hi Kausan

    Are you able to get the value in string type variable propValue and want to set this value in hidden field right ? or something else, please clear this.

    Thanks

  • Kasun 8 posts 77 karma points
    May 12, 2016 @ 13:03
    Kasun
    0

    Hi Manish,

    Yds..I can get the value to the variable..just want to set it to the hidden field...

    Thanks

  • Manish 373 posts 932 karma points
    May 12, 2016 @ 13:04
    Manish
    0

    Hi

    <input type="hidden" value="@propvalue" />
    

    is this not working for you

    Manish

  • Kasun 8 posts 77 karma points
    May 12, 2016 @ 13:09
    Kasun
    0

    Hi Manish

    I cant use it because its a Umbraco Form and its rendering as a macro.. thats why I m tring to use the Form's hidden field and bracket syntax

    Kasun

  • Manish 373 posts 932 karma points
    May 12, 2016 @ 13:13
    Manish
    0

    Hi

     @Html.HiddenFor(x => Model.FormId)
    

    use this one

  • Kasun 8 posts 77 karma points
    May 12, 2016 @ 13:17
    Kasun
    0

    Hi Manish

    Ill try and let you know

    Thanks Kasun

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies