So what could cause this error?
here is my code
Expand|Select|Wrap|Line Numbers
- using System;
- using System.Collections.Generic;
- using System.Web;
- public class Redirect : IHttpModule
- {
- public Redirect() { }
- public void Dispose()
- {
- }
- public void Init(HttpApplication context)
- {
- context.BeginRequest += new EventHandler(context_BeginRequest);
- }
- void context_BeginRequest(object sender, EventArgs e)
- {
- HttpApplication AppObject = (HttpApplication)sender;
- {
- string serverName = HttpUtility.UrlEncode(AppObject.Request.ServerVariables["SERVER_NAME"]);
- string filePath = AppObject.Request.FilePath;
- string queryurl = AppObject.Request.Url.Query;
- string absURL = AppObject.Request.Url.AbsoluteUri;
- ///Some condition
- string NewURLa = "/Default.aspx?TabId=189&NewsId=32453";
- HttpContext.Current.RewritePath(NewURLa);
- }
- }
- }
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetNuke.Services.Localization.Localization.GetE nabledLocales()
at DotNetNuke.Framework.PageBase.get_PageCulture()
at DotNetNuke.Framework.PageBase.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
Thanks