CustomPlaceholder and PostingEvents
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
CustomPlaceholder and PostingEvents

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
Gonçalo Boléo
Guest





Posted: Mon Jan 10, 2005 11:12 pm    Post subject: CustomPlaceholder and PostingEvents Reply with quote

I'm making a placeholder that will throw an exception when it's not filled.
I'm having two problems:
1) I wan't to have a property with the placeholder value but don't know
in wich event assing it.
2) My validate function is throwed several times and i don't understant
why.
I use "PostingEvents.Current.Approving += new
ChangingEventHandler(ValidatePlaceholder)" in OnInit function and have no
calls to this function elsewhere.

thanks,
Gonçalo Boléo
Back to top
Stefan [MSFT]
Guest





Posted: Tue Jan 11, 2005 12:56 am    Post subject: Re: CustomPlaceholder and PostingEvents Reply with quote

Hi Goncalo,

it is not highly not recommended to add a workflow event inside a OnInit
function!

The reason is that there is only one PostingEvent object for the whole
application.
This means: adding this function inside a posting will affect ALL(!) other
postings (independend from template) and all other users until IIS is
restarted!

You should only use workflow events inside the global.asax.cs or in a custom
http module.

This might also explain why the function is fired multiple times: you are
registering it new in every posting.
So after 50 posting requests the event might be registered 50 times - and so
on.

About your questions:
1) are you talking about default content? Use the OnPopulatingDefaultContent
event.

Cheers,
Stefan.

"Gonçalo Boléo" <gboleo@netcabo.pt> wrote in message
news:Ojjbkfz9EHA.1564@TK2MSFTNGP09.phx.gbl...
Quote:
I'm making a placeholder that will throw an exception when it's not
filled.
I'm having two problems:
1) I wan't to have a property with the placeholder value but don't
know
in wich event assing it.
2) My validate function is throwed several times and i don't
understant
why.
I use "PostingEvents.Current.Approving += new
ChangingEventHandler(ValidatePlaceholder)" in OnInit function and have no
calls to this function elsewhere.

thanks,
Gonçalo Boléo


Back to top
Gonçalo Boléo
Guest





Posted: Tue Jan 11, 2005 1:12 am    Post subject: Re: CustomPlaceholder and PostingEvents Reply with quote

Thanks

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:eGBkaY09EHA.1396@tk2msftngp13.phx.gbl...
Quote:
Hi Goncalo,

it is not highly not recommended to add a workflow event inside a OnInit
function!

The reason is that there is only one PostingEvent object for the whole
application.
This means: adding this function inside a posting will affect ALL(!) other
postings (independend from template) and all other users until IIS is
restarted!

You should only use workflow events inside the global.asax.cs or in a
custom
http module.

This might also explain why the function is fired multiple times: you are
registering it new in every posting.
So after 50 posting requests the event might be registered 50 times - and
so
on.

About your questions:
1) are you talking about default content? Use the
OnPopulatingDefaultContent
event.

Cheers,
Stefan.

"Gonçalo Boléo" <gboleo@netcabo.pt> wrote in message
news:Ojjbkfz9EHA.1564@TK2MSFTNGP09.phx.gbl...
I'm making a placeholder that will throw an exception when it's not
filled.
I'm having two problems:
1) I wan't to have a property with the placeholder value but don't
know
in wich event assing it.
2) My validate function is throwed several times and i don't
understant
why.
I use "PostingEvents.Current.Approving += new
ChangingEventHandler(ValidatePlaceholder)" in OnInit function and have
no
calls to this function elsewhere.

thanks,
Gonçalo Boléo




Back to top
Gonçalo Boléo
Guest





Posted: Tue Jan 11, 2005 1:18 am    Post subject: Re: CustomPlaceholder and PostingEvents Reply with quote

Is there any sample code that reflects this situation?

thanks,
Gonçalo Boléo

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:eGBkaY09EHA.1396@tk2msftngp13.phx.gbl...
Quote:
Hi Goncalo,

it is not highly not recommended to add a workflow event inside a OnInit
function!

The reason is that there is only one PostingEvent object for the whole
application.
This means: adding this function inside a posting will affect ALL(!) other
postings (independend from template) and all other users until IIS is
restarted!

You should only use workflow events inside the global.asax.cs or in a
custom
http module.

This might also explain why the function is fired multiple times: you are
registering it new in every posting.
So after 50 posting requests the event might be registered 50 times - and
so
on.

About your questions:
1) are you talking about default content? Use the
OnPopulatingDefaultContent
event.

Cheers,
Stefan.

"Gonçalo Boléo" <gboleo@netcabo.pt> wrote in message
news:Ojjbkfz9EHA.1564@TK2MSFTNGP09.phx.gbl...
I'm making a placeholder that will throw an exception when it's not
filled.
I'm having two problems:
1) I wan't to have a property with the placeholder value but don't
know
in wich event assing it.
2) My validate function is throwed several times and i don't
understant
why.
I use "PostingEvents.Current.Approving += new
ChangingEventHandler(ValidatePlaceholder)" in OnInit function and have
no
calls to this function elsewhere.

thanks,
Gonçalo Boléo




Back to top
Stefan [MSFT]
Guest





Posted: Tue Jan 11, 2005 2:39 pm    Post subject: Re: CustomPlaceholder and PostingEvents Reply with quote

Yes:
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=086540ba-1689-4471-9d9e-78cddaafb3a0

"Gonçalo Boléo" <gboleo@netcabo.pt> wrote in message
news:uDWhRm09EHA.1392@tk2msftngp13.phx.gbl...
Quote:
Is there any sample code that reflects this situation?

thanks,
Gonçalo Boléo

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:eGBkaY09EHA.1396@tk2msftngp13.phx.gbl...
Hi Goncalo,

it is not highly not recommended to add a workflow event inside a OnInit
function!

The reason is that there is only one PostingEvent object for the whole
application.
This means: adding this function inside a posting will affect ALL(!)
other
postings (independend from template) and all other users until IIS is
restarted!

You should only use workflow events inside the global.asax.cs or in a
custom
http module.

This might also explain why the function is fired multiple times: you
are
registering it new in every posting.
So after 50 posting requests the event might be registered 50 times -
and
so
on.

About your questions:
1) are you talking about default content? Use the
OnPopulatingDefaultContent
event.

Cheers,
Stefan.

"Gonçalo Boléo" <gboleo@netcabo.pt> wrote in message
news:Ojjbkfz9EHA.1564@TK2MSFTNGP09.phx.gbl...
I'm making a placeholder that will throw an exception when it's not
filled.
I'm having two problems:
1) I wan't to have a property with the placeholder value but don't
know
in wich event assing it.
2) My validate function is throwed several times and i don't
understant
why.
I use "PostingEvents.Current.Approving += new
ChangingEventHandler(ValidatePlaceholder)" in OnInit function and have
no
calls to this function elsewhere.

thanks,
Gonçalo Boléo






Back to top
Gonçalo Boléo
Guest





Posted: Tue Jan 11, 2005 8:20 pm    Post subject: Re: CustomPlaceholder and PostingEvents Reply with quote

Thanks again!
Your help has benn very useful!

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:e2QERk79EHA.3260@TK2MSFTNGP14.phx.gbl...
Quote:
Yes:

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=086540ba-1689-4471-9d9e-78cddaafb3a0

"Gonçalo Boléo" <gboleo@netcabo.pt> wrote in message
news:uDWhRm09EHA.1392@tk2msftngp13.phx.gbl...
Is there any sample code that reflects this situation?

thanks,
Gonçalo Boléo

"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message
news:eGBkaY09EHA.1396@tk2msftngp13.phx.gbl...
Hi Goncalo,

it is not highly not recommended to add a workflow event inside a
OnInit
function!

The reason is that there is only one PostingEvent object for the whole
application.
This means: adding this function inside a posting will affect ALL(!)
other
postings (independend from template) and all other users until IIS is
restarted!

You should only use workflow events inside the global.asax.cs or in a
custom
http module.

This might also explain why the function is fired multiple times: you
are
registering it new in every posting.
So after 50 posting requests the event might be registered 50 times -
and
so
on.

About your questions:
1) are you talking about default content? Use the
OnPopulatingDefaultContent
event.

Cheers,
Stefan.

"Gonçalo Boléo" <gboleo@netcabo.pt> wrote in message
news:Ojjbkfz9EHA.1564@TK2MSFTNGP09.phx.gbl...
I'm making a placeholder that will throw an exception when it's not
filled.
I'm having two problems:
1) I wan't to have a property with the placeholder value but
don't
know
in wich event assing it.
2) My validate function is throwed several times and i don't
understant
why.
I use "PostingEvents.Current.Approving += new
ChangingEventHandler(ValidatePlaceholder)" in OnInit function and
have
no
calls to this function elsewhere.

thanks,
Gonçalo Boléo








Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

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




New Topics Powered by phpBB