Microsoft Content Management Server - CmsHttpContext in Application events...

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > September 2004 > CmsHttpContext in Application events...





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author CmsHttpContext in Application events...
Stefano

2004-09-08, 2:48 am

Hi all,

I'm trying to write code into "Application_AuthenticateRequest" event
handler into a custom HttpModule
If I access to CmsHttpContext.Current, I have NullReferenceException.

I believe this is normal, because MCMS didn't create its context in that
point.... is it right?

So... What are application events in which I can access to CmsHttpContext?

Thank you so much.

Bye

Stefano


Stefan [MSFT]

2004-09-08, 7:48 am

Hi Stefano,

I have used this context inside the OnPreRequestHandlerExecute event.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver

MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"Stefano" <stefano__REMOVETHIS__@giasoft.it> wrote in message
news:eXzacAYlEHA.3536@TK2MSFTNGP12.phx.gbl...
> Hi all,
>
> I'm trying to write code into "Application_AuthenticateRequest" event
> handler into a custom HttpModule
> If I access to CmsHttpContext.Current, I have NullReferenceException.
>
> I believe this is normal, because MCMS didn't create its context in that
> point.... is it right?
>
> So... What are application events in which I can access to CmsHttpContext?
>
> Thank you so much.
>
> Bye
>
> Stefano
>
>



Stefano

2004-09-08, 7:48 am

Hi Stefan,

Now I'm using OnPreRequestHandlerExecute event too... and I can access to
Cmshttpcontext.

But... Now I cannot redirect the request to another page. I receive the
following message: Cannot redirect after HTTP headers have been sent.

My code has not sent any http header.

So... how is it possible?
Maybe some MCMS module sends http headers before me?

Thank you so much.

Bye

Stefano

"Stefan [MSFT]" <stefang@online.microsoft.com> ha scritto nel messaggio
news:uyF3T8YlEHA.3156@TK2MSFTNGP12.phx.gbl...
> Hi Stefano,
>
> I have used this context inside the OnPreRequestHandlerExecute event.
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no

rights.
>
> MCMS FAQ:
>

http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
>

http://www.gotdotnet.com/community/...t+S
erver

> MCMS Whitepapers and other docs:
> http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
> --------------------------------
>
>
> "Stefano" <stefano__REMOVETHIS__@giasoft.it> wrote in message
> news:eXzacAYlEHA.3536@TK2MSFTNGP12.phx.gbl...
CmsHttpContext?[vbcol=seagreen]
>
>



Stefan [MSFT]

2004-09-08, 7:48 am

Hi Stefano,

I have written a http module which does such redirects and works fine:
http://blogs.msdn.com/stefan_gossne.../14/155231.aspx

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver

MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"Stefano" <stefano__REMOVETHIS__@giasoft.it> wrote in message
news:etWdCBZlEHA.3544@TK2MSFTNGP15.phx.gbl...
> Hi Stefan,
>
> Now I'm using OnPreRequestHandlerExecute event too... and I can access to
> Cmshttpcontext.
>
> But... Now I cannot redirect the request to another page. I receive the
> following message: Cannot redirect after HTTP headers have been sent.
>
> My code has not sent any http header.
>
> So... how is it possible?
> Maybe some MCMS module sends http headers before me?
>
> Thank you so much.
>
> Bye
>
> Stefano
>
> "Stefan [MSFT]" <stefang@online.microsoft.com> ha scritto nel messaggio
> news:uyF3T8YlEHA.3156@TK2MSFTNGP12.phx.gbl...
> rights.
>

http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
>

http://www.gotdotnet.com/community/...t+S
erver

that[vbcol=seagreen]
> CmsHttpContext?
>
>



Stefano

2004-09-08, 7:48 am

Hi Stefan,

I was reading your blog... I implemented a HttpModule like yours. But, when
I call Response.Redirect, I have "Cannot redirect after HTTP headers have
been sent"

It's so strange.... :-(

Thank you so much.

Bye


"Stefan [MSFT]" <stefang@online.microsoft.com> ha scritto nel messaggio
news:u1kjBVZlEHA.3564@TK2MSFTNGP14.phx.gbl...
> Hi Stefano,
>
> I have written a http module which does such redirects and works fine:
> http://blogs.msdn.com/stefan_gossne.../14/155231.aspx
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no

rights.
>
> MCMS FAQ:
>

http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
>

http://www.gotdotnet.com/community/...t+S
erver

> MCMS Whitepapers and other docs:
> http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
> --------------------------------
>
>
> "Stefano" <stefano__REMOVETHIS__@giasoft.it> wrote in message
> news:etWdCBZlEHA.3544@TK2MSFTNGP15.phx.gbl...
to[vbcol=seagreen]
>

http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
>

http://www.gotdotnet.com/community/...t+S
erver

event[vbcol=seagreen]
NullReferenceException.[vbcol=seagreen]
> that
>
>



Stefan [MSFT]

2004-09-08, 7:48 am

Hi Stefano,

please create a new project and add this module.
Create a new template and drag & drop only the console and one html
placeholder to it.
Do not add any custom modules to this project.
Test if this works.

If yes, then there is some code in your project that interacts with this
module.

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver

MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


"Stefano" <stefano__REMOVETHIS__@giasoft.it> wrote in message
news:#kID46ZlEHA.396@tk2msftngp13.phx.gbl...
> Hi Stefan,
>
> I was reading your blog... I implemented a HttpModule like yours. But,

when
> I call Response.Redirect, I have "Cannot redirect after HTTP headers have
> been sent"
>
> It's so strange.... :-(
>
> Thank you so much.
>
> Bye
>
>
> "Stefan [MSFT]" <stefang@online.microsoft.com> ha scritto nel messaggio
> news:u1kjBVZlEHA.3564@TK2MSFTNGP14.phx.gbl...
> rights.
>

http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
>

http://www.gotdotnet.com/community/...t+S
erver

> to
the[vbcol=seagreen]
messaggio[vbcol=seagreen]
event.[vbcol=seagreen]
>

http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
>

http://www.gotdotnet.com/community/...t+S
erver

> event
> NullReferenceException.
in[vbcol=seagreen]
>
>



Stefano

2004-09-08, 5:49 pm

Now everything is OK !

FFFiuuuu ... Just a coding error ...

Thank you so much.

Bye

Stefano


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com