Copied to clipboard

Flag this post as spam?

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


  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 13, 2011 @ 19:29
    Johan Plesner Hamann
    0

    edit member property api

    why is it that this works.

     Member member = Member.GetCurrentMember();
    member.getProperty("bio").Value = "new text"; // TextBox_bio.Text.ToString();

    But this does not work?

     Member member = Member.GetCurrentMember();
    member.getProperty("bio").Value = TextBox_bio.Text.ToString();

    It makes no sense!?

    - Johan



  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Feb 13, 2011 @ 21:23
    Hendy Racher
    0

    Hi Johan,

    Yes that seems odd, what does the following do ?

    Member member = Member.GetCurrentMember();
    member
    .getProperty("bio").Value = TextBox_bio.Text;

    Cheers,

    Hendy

  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 13, 2011 @ 21:40
    Johan Plesner Hamann
    0

    a member is logged. and have the option of to edit own content.

    you can see the code here.

     protected void Button_save_Click(object sender, EventArgs e)
    {
    if (Page.IsValid)
    {
    member.Text = TextBox_navn.Text.ToString();
    member.Email = TextBox_email.Text.ToString();
    member.LoginName = TextBox_email.Text.ToString();
    member.getProperty("telefon").Value = TextBox_tlf.Text.ToString();
    member.getProperty("bio").Value = TextBox_bio.Text.ToString()

    }

    }

    I can change the content by hard code it, but not out through textbox
    should I save as admin or something like that?

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Feb 13, 2011 @ 21:56
    Hendy Racher
    0

    Hi Johan,

    Just wondering why are you doing a ToString() on a string ?

    Can you step though debug to ensure that the following has a value ?

    TextBox_navn.Text.ToString();

    Cheers,

    Hendy

  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 13, 2011 @ 22:16
    Johan Plesner Hamann
    0

    Hey Hendy

    Thank you for helping.

    it have a value. and an error "Use the New keyword skabe the instance."
    I still do not understand why I can not give a value in out through a textbox.

    Johan

     

  • Jason Prothero 422 posts 1243 karma points MVP c-trib
    Feb 13, 2011 @ 22:38
    Jason Prothero
    0

    Johan,

    This works for me:

                    member.getProperty("shippingAddress1").Value = this.ctrlShippingAddress1TextBox.Text;
                    member.getProperty("shippingAddress2").Value = this.ctrlShippingAddress2TextBox.Text;

    What error are you getting?

  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 13, 2011 @ 23:03
    Johan Plesner Hamann
    0

    ok now I feel stupid. it is resolved, after having looked at it so much. you become blind.

    removed .toString()

    have just learned in school to "toString" on anything that does not work.
    and one can tend to stick with it.

     

    Thanks Hendy,
    and thanks Jason for replying.

    Pretty new to this API

    Cheers - Johan


Please Sign in or register to post replies

Write your reply to:

Draft