I implemented a script in my master template to detect language browser settings:
<script language="C#" runat="server"> protected void Page_Load(object sender, EventArgs e) { if(Request.UserLanguages != null && Request.ServerVariables["script_name"] == "/") { string language = Request.UserLanguages[0]; if(!string.IsNullOrEmpty(language)) { //Get the culture name - and make sure it's in the RFC 1766 standard <languagecode2>-<country/regioncode2> //i.e. en-GB, so it's easier to check for if (language.Length < 3) language += "-" + language.ToUpper(); //Redirect to the correct page based on language, default to english switch(language) { case "en-US": Response.Redirect("/home.aspx"); break; case "nl-BE": Response.Redirect("/startpagina.aspx"); break; case "fr-BE": Response.Redirect("/accueil.aspx"); break; default: Response.Redirect("/home.aspx"); break; } } } } </script>
for some reason this script is not working, so now I want to debug the script in Visual Studio. As shown in the video on Debugging by Niels Hartvig, I have attached to the w3wp.exe process in Visual Studio, but once I attachted to the process I am not able to step into the breakpoint. I also set the debug=true configuration in the web.config file:
cannot debug master template
Hi,
I implemented a script in my master template to detect language browser settings:
<script language="C#" runat="server">
protected void Page_Load(object sender, EventArgs e) {
if(Request.UserLanguages != null && Request.ServerVariables["script_name"] == "/") {
string language = Request.UserLanguages[0];
if(!string.IsNullOrEmpty(language)) {
//Get the culture name - and make sure it's in the RFC 1766 standard <languagecode2>-<country/regioncode2>
//i.e. en-GB, so it's easier to check for
if (language.Length < 3)
language += "-" + language.ToUpper();
//Redirect to the correct page based on language, default to english
switch(language) {
case "en-US":
Response.Redirect("/home.aspx");
break;
case "nl-BE":
Response.Redirect("/startpagina.aspx");
break;
case "fr-BE":
Response.Redirect("/accueil.aspx");
break;
default:
Response.Redirect("/home.aspx");
break;
}
}
}
}
</script>
for some reason this script is not working, so now I want to debug the script in Visual Studio. As shown in the video on Debugging by Niels Hartvig, I have attached to the w3wp.exe process in Visual Studio, but once I attachted to the process I am not able to step into the breakpoint. I also set the debug=true configuration in the web.config file:
<compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.0">
Am I overlooking something, or is it not possible to debug a master template in Visual Studio?
greetings,
Anthony Candaele
Belgium
found the problem. In 'start options' in visual studio, I needed to change the setting from 'default server' to 'custom server'
is working on a reply...