Welcome to the Community Exchange, a place where community members can exchange questions and answers related to DotNetNuke. If you would like more info about the Community Exchange, please visit this page in our Wiki.
Hi
I am trying to use MemberId as a Knockout token and am getting an JavaScript error saying that MemberId binding is not defined.
I am using it like this
data-bind="attr: { title: MemberId}
Also I was hoping someone could explain some knockout syntax for me. With the HTML module token replacement I can produce the following string http://mysite.com/profile?userid=1 by doing this http://mysite.com/profile?userid=[Users:UserId] How can I do this with knockout? I the usage examples I have seen, knockout is binding to attributes. I have yet to see an example of concatenation. Thanks for the help
Mark
Since the forum cut off my code, let's see if the exchange handles it better
Mark, You would need to use the UserId attribute. If you wanted to add it to a span you could do it like <span data-bind="text: UserId"></span>
I suggest to inspect the ViewModel behind using javascript developer tools like firebug (or the tools build into the browsers available through F12).
The answer to this was to use UserId. I guess in my attempts previous I was using userId (note the case) and it was not working which got me on the path to MemberId. - Mark Hollas 8/13/2012
I have done that and I do see that there is self.UserId = ko.observable(item.MemberId) in memberdirecroty.js so I don't quite understand why I can not use the binding. - Mark Hollas 8/12/2012
You have already flagged this post. Clicking "Remove Flag" below will remove your flag, thus reducing the count by one as well.