2
Answers

Application_BeginRequest in Global.asax wont execute!!!

David McEleney

David McEleney

18y
5.7k
1

Hi guys,

I'm trying to get a Application_BeginRequest in Global.asax to execute but it wont.

My Global.asax looks something like this:

<%
@ Application Language="C#" %>
<%
@ Import Namespace="System.IO" %>
<%
@ Import Namespace="System.Collections.Generic" %>
<%
@ Import Namespace="System.Globalization" %>
<%
@ Import Namespace="System.Xml" %>
<%
@ Import Namespace="System.Reflection" %>
<%
@ Import Namespace="System.Threading" %>
<%
@ Import Namespace="System.Web" %>

<script
runat="server">
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["vizor"];
if (cookie != null)
{
String culture = cookie.Values["culture"].ToString();
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
}
}

// Other methods go here

</script>

Does anyone have any suggestions as to why it wont execute? I dont have any event handlers set up, and dont know if / where i have to.

Please advise!!!

David

Answers (2)
0
sailorfoley
NA 97 0 20y
yes it can i have gotten it to work.the only problem i came across is that the folder where you reference your dll must contain the xml file that contains the information about the DLL. Try making the XML file the same name as the assembly