To actually assign a domain name to a node, I don't think there is a method in the umbraco library for that. it looks like that happens in umbraco.cms.businesslogic.web.Domain. I would take a look at umbraco.cms.businesslogic.web.Domain.cs (in the source code). To see the example of how it is used you can look at presentation/umbraco/dialogs/AssignDomain.aspx.cs.
How to get Domain Names assigned to a node using API?
How to get Domain Names assigned to a node using API?
---vijay.
Take a look at umbraco.library.GetCurrentDomain(int nodeId)
Thomas
To actually assign a domain name to a node, I don't think there is a method in the umbraco library for that. it looks like that happens in umbraco.cms.businesslogic.web.Domain. I would take a look at umbraco.cms.businesslogic.web.Domain.cs (in the source code). To see the example of how it is used you can look at presentation/umbraco/dialogs/AssignDomain.aspx.cs.
Sorry, read false (how to get all domains from one node)...
@Vijay: Didn't you asked this question before: http://our.umbraco.org/forum/developers/extending-umbraco/6056-How-to-assign-domain-to-a-node-programatically?p=0#comment21804
Dirk pointed to a solution...
Cheers, Thomas
Heelo Thomas,
Thanks for your reply but my question is How to get the domain names assaigned to a node? and
my previous question is How to assign domains to a node?
cheers,
--vijay.
Sorry for the unconvenience Vijay, reacted on the comment from sniemuth without reading completely...
So for the question How to get the domain names assaigned to a node? the solution would be the api call mentioned above:
umbraco.library.GetCurrentDomain(int nodeId) where nodeId is the id of the node to get the domains from.
hth,
Thomas
...Or use Domain.GetDomainsById(nodeId) which returns an array of Domain
Cheers,
/Dirk
Which is the same, cause the library function uses Domain.GetDomainsById
;-)
is working on a reply...