CmsHttpContext in Application events...
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > CmsHttpContext in Application events...




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    CmsHttpContext in Application events...  
Stefano


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-08-04 07: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







[ Post a follow-up to this message ]



    Re: CmsHttpContext in Application events...  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-08-04 12:48 PM

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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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
>
>







[ Post a follow-up to this message ]



    Re: CmsHttpContext in Application events...  
Stefano


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-08-04 12:48 PM

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:
>

> MCMS Blog: [url]http://blogs.msdn.com/stefan_gossner/category/4983.aspx" target="_blank">http://download.microsoft.com/downl...egory/4983.aspx
> MCMS Sample Code:
>
http://www.gotdotnet.com/community/...
+Server
> 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] 
>
>







[ Post a follow-up to this message ]



    Re: CmsHttpContext in Application events...  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-08-04 12:48 PM

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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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 messaggi
o
> news:uyF3T8YlEHA.3156@TK2MSFTNGP12.phx.gbl... 
> rights. 
>
 
>
[url]http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management
+Server" target="_blank">http://download.microsoft.com/downl...
+Server 
that[vbcol=seagreen] 
> CmsHttpContext? 
>
>







[ Post a follow-up to this message ]



    Re: CmsHttpContext in Application events...  
Stefano


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-08-04 12:48 PM

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:
>

> MCMS Blog: [url]http://blogs.msdn.com/stefan_gossner/category/4983.aspx" target="_blank">http://download.microsoft.com/downl...egory/4983.aspx
> MCMS Sample Code:
>
http://www.gotdotnet.com/community/...
+Server
> 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] 
>
 
>
[url]http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management
+Server" target="_blank">http://download.microsoft.com/downl...
+Server 
event[vbcol=seagreen] 
NullReferenceException.[vbcol=seagreen] 
> that 
>
>







[ Post a follow-up to this message ]



    Re: CmsHttpContext in Application events...  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-08-04 12:48 PM

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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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 messaggi
o
> news:u1kjBVZlEHA.3564@TK2MSFTNGP14.phx.gbl... 
> rights. 
>
 
>
[url]http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management
+Server" target="_blank">http://download.microsoft.com/downl...
+Server 
> to 
the[vbcol=seagreen] 
messaggio[vbcol=seagreen] 
event.[vbcol=seagreen] 
>
 
>
[url]http://www.gotdotnet.com/community/usersamples/Default.aspx?ProductDropDownList=Content+Management
+Server" target="_blank">http://download.microsoft.com/downl...
+Server 
> event 
> NullReferenceException. 
in[vbcol=seagreen] 
>
>







[ Post a follow-up to this message ]



    Re: CmsHttpContext in Application events...  
Stefano


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-08-04 10:49 PM

Now everything is OK !

FFFiuuuu ... Just a coding error ...

Thank you so much.

Bye

Stefano







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:57 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register