Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9123861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:26:30+00:00 2026-06-17T06:26:30+00:00

I created simple HttpModule , all what I need is just get is valid

  • 0

I created simple HttpModule, all what I need is just get is valid Sitecore.Context inside but during processing I see that my Sitecore.Context is some kind of default.

I can get Sitecore user that log in to Sitecore, etc.
How to fix it ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:26:31+00:00Added an answer on June 17, 2026 at 6:26 am

    I assume you have a Sitecore Context, but it is null or set to the wrong site or language.
    You can change the context like this:

    // switch to the preferred site    
    Sitecore.Context.SetActiveSite("yourSiteName");
    
    // set the preferred database
    Sitecore.Context.Database = Sitecore.Configuration.Factory.GetDatabase("master");
    
    // set the preferred language
    Language language =  Sitecore.Globalization.Language.Parse("en");
    Sitecore.Context.SetLanguage = (language, false);
    

    You probably also want to switch back to the original settings after your processing is done. So it is wise to “save” the original settings in a variable so you can change them back afterwards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created simple code in MVS2010 but it doesn't work. There is just a
I am new to Repository concept and get some questions. I have created simple
I created my custom assembly that has a simple HttpModule in it that I'd
I've created simple Hello world portlet and just added <use-default-template>true</use-default-template> to the portlet section
I've created simple Command line app from XCode 4.5, however I'd need to compile
I've created simple trigger to create cloud table (MyISAM table just to perfor FULL
I have created simple chat application using smack api.i can able to chat well.but
I've created a simple HttpModule and response stream to reformat the rendered output of
I have created simple script: #!/bin/sh column=${1:-1} awk '{colawk='$column'+1; print colawk}' But when I
I've created a simple httpModule, registered it on GAC and added it to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.