Copied to clipboard

Flag this post as spam?

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


  • praveen 113 posts 164 karma points
    Mar 01, 2011 @ 00:55
    praveen
    0

    Read Textbox datatype value in usercontrol

    Hi There,

    I have created a Textbox datatype called "EmailAddressContact "

    now I want to read EmailAddressContact .Text in my UserControl code.

    Your help is greatly appreciated

    Regards

    Sword

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 01, 2011 @ 08:21
    Jan Skovgaard
    0

    Hi praveen

    I think you might find this helpfull then: http://our.umbraco.org/wiki/reference/api-cheatsheet/modifying-document-properties

    Here you can also see how to create new nodes using the API etc.

    Hope this helps.

    /Jan

  • praveen 113 posts 164 karma points
    Mar 01, 2011 @ 09:09
    praveen
    0

    Hi Jan

    Many thanks for the reply and the solution

    can you please tell me how do I get the document id (1029)

    Document doc = new Document(1029);

    I think i need to do the follwing to read value of the document property

    string emailtext = doc.getProperty("EmailAddressContact ").Value ;

    Please let me know, and many thanks for your help.

    Kind Regards

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 01, 2011 @ 10:25
    Jan Skovgaard
    0

    Hi praveen

    You find the nodeid in Umbraco backoffice by either looking at a specific document in the "properties" tab - Here you can see the ID.

    You can also just hold your mouse over a specific node and look in the lower left corner. Here you'll also see the ID of the node.

    But it's never a good idea to use hardcoded ID's in the code so I think you should be able to access the ID of the current node the macro is being used on by writing something like this:

    Node node =  Node.GetCurrent().id; This should give you the id of the current node, so you can then pass the "node" to the

    Document doc = new Document(node);

    Does this make sense to you? (I'm not that skilled at C# :))

    /Jan

  • jigar 170 posts 233 karma points
    May 16, 2011 @ 08:36
    jigar
    0

    Is this resolved? Did you able to use the value of your custom doctype? I need to do similar stuff so...

Please Sign in or register to post replies

Write your reply to:

Draft