Could Not Publish from Code... Options
kailash.shastri
Posted: Tuesday, May 20, 2008 4:20:05 PM
Rank: Newbie

Joined: 5/20/2008
Posts: 4
Location: New Delhi
Hi All,

I am trying to create a document and publish it umbraco from my .net project. I have created a document successfully and published it too. Everything seems to work fine. but, Link to document doesn't appear on the Umbraco's UI. When I publish it from Umbraco's UI link becomes visible to me. Here is the main piece of code I am using...

=========================================

DocumentType dt = DocumentType.GetByAlias("HomePage");

umbraco.BusinessLogic.User u = new umbraco.BusinessLogic.User(0);

int parent = 1091;

Document d = new Document(1748);

d.getProperty("PageHeader").Value = "Kailash Test2";

d.Publish(u);

umbraco.library.PublishSingleNode(d.Id);

==========================================

I tried a lot to fix this...Sick

Thank you very much in advance..
Kailash
tim
Posted: Tuesday, May 20, 2008 4:25:07 PM

Rank: Addict

Joined: 2/19/2007
Posts: 741
Location: Belgium
You need to add an extra line, not sure the correct line by heart, but is something like content.refreshcontentasync() . I'll look it up.

Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
kailash.shastri
Posted: Tuesday, May 20, 2008 4:44:58 PM
Rank: Newbie

Joined: 5/20/2008
Posts: 4
Location: New Delhi
Hi Tim,

Thanks for your quick reply.

I added umbraco.content.Instance.RefreshContentFromDatabaseAsync(); line at the end but it didn't work too.

BTW, I am using v3.0.3 and using dlls in my projects rather than using umbraco's code..

Thanks
Kailash
tim
Posted: Tuesday, May 20, 2008 4:48:18 PM

Rank: Addict

Joined: 2/19/2007
Posts: 741
Location: Belgium
Does the trick where I use it, but not on a 3.0.3 site, maybe try upgrading to .4 or .5

Umbraco tips and tricks: http://www.nibble.be - umbraco mvp 08/09 - certified level 1 & 2 professional
kailash.shastri
Posted: Wednesday, May 21, 2008 10:14:44 AM
Rank: Newbie

Joined: 5/20/2008
Posts: 4
Location: New Delhi
Hi Tim,

I have upgraded from v3.0.3 to v3.0.5 but the problem is still there. I have included the new dlls (umbraco v 3.0.5 (Assembly version: 1.0.3050.25839)) in my .net project as well as upgraded my server with v3.0.5. Although, this seems to be a nightmare for me.. Please help.

Thanks
Kailash

kailash.shastri
Posted: Thursday, May 22, 2008 7:34:27 AM
Rank: Newbie

Joined: 5/20/2008
Posts: 4
Location: New Delhi
Anyone, who resolved the similar issue ...

Any help will be appreciated.

Thanks
Kailash
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.