I swear, I am putting as small a snippet of my code in here as I can. I have also Googled the heck out of this skanker. I am really befuddled as to why the above is happening. I have a .asmx files such as this:
<%@ WebService Language="C#" CodeBehind="MakeModelWebService.asmx.cs" Class="BSA.UI.Web.C8.TireAdvisor.MakeModelWebService" %>
And the codebehind is thus:
<pre>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class MakeModelWebService : System.Web.Services.WebService
{
IAdvisorModelRepository advisorModelRepository = new AdvisorModelRepository();
const string TESTLANGUAGE = "English";
const string TESTBRANDCODE = "BR";
[WebMethod]
[ScriptMethod]
public CascadingDropDownNameValue[] GetYears(string knownCategoryValues, string category)
{
try
{
var values = new List<CascadingDropDownNameValue>();
foreach (string year in advisorModelRepository.GetYears(TESTLANGUAGE, TESTBRANDCODE))
{
values.Add(new CascadingDropDownNameValue { name = year, value = year });
}
return values.ToArray();
}
catch (Exception ex)
{
File.WriteAllText(
Server.MapPath("~/TireAdvisor/ErrorLog.txt"),
ex.Message + "\r\n\r\n" + ex.Source + "\r\n\r\n" + ex.StackTrace);
File.WriteAllText(
Server.MapPath("~/~/TireAdvisor/ErrorLog2.txt"),
ex.InnerException.Message + "\r\n\r\n" + ex.InnerException.Source + "\r\n\r\n" + ex.InnerException.StackTrace);
return null;
}
}
}
No error logs are written on the server, so an exception did not happen. Here is the cascading drop down in my ASPX:
<tr>
<td>
<cm:ContentLabel ID="ContentLabel4" runat="server" ContentTag="TS-Wizard-Year" Text="Select Year" />
</td>
<td>
<asp:DropDownList ID="ddlYear" runat="server" AutoPostBack="false" Font-Names="Tahoma" />
<cm:ContentLabel ID="lblYearRequired" runat="server" ContentTag="RequiredError" Visible="false" Width="0px" />
<!-- JSON Drop down. Set autopostback to false and remove onselected index. Remove asyc triggers -->
<ajaxToolkit:CascadingDropDown ID="ccdYear" runat="server" TargetControlID="ddlYear" Category="Year" ServicePath="MakeModelWebService.asmx" EnableViewState="true" />
</td>
</tr>
In the codebehind the cascading drop down is configured thus:
private void ConfigureCascadingDropDowns()
{
ccdYear.PromptText = ccdYear.EmptyText = DropDownTextDriver.GetChooseYearText(
this.LanguageString);
ccdMake.PromptText = ccdMake.EmptyText = DropDownTextDriver.GetChooseMakeText(
this.LanguageString);
ccdModel.PromptText = ccdModel.EmptyText = DropDownTextDriver.GetChooseModelText(
this.LanguageString);
ccdYear.PromptValue = ccdYear.EmptyValue = string.Empty;
ccdMake.PromptValue = ccdMake.EmptyValue = string.Empty;
ccdModel.PromptValue = ccdModel.EmptyValue = string.Empty;
switch (UserState.SearchMode)
{
default:
ccdYear.ServiceMethod = "GetYearsPageMethod";
ccdYear.TargetControlID = ddlYear.ID;
ccdMake.ServiceMethod = "GetMakes";
ccdMake.TargetControlID = ddlMake.ID;
ccdMake.ParentControlID = ddlYear.ID;
ccdModel.ServiceMethod = "GetModelsForYearAndMake";
ccdModel.ParentControlID = ddlMake.ID;
ccdModel.TargetControlID = ddlModel.ID;
break;
case QuickSearchMode.MakeOnly:
case QuickSearchMode.MakeAndModelOnly:
ccdMake.ParentControlID = string.Empty;
ccdMake.ServiceMethod = "GetAllMakes";
ccdMake.TargetControlID = ddlMake.ID;
ccdModel.ParentControlID = ddlMake.ID;
ccdModel.ServiceMethod = "GetModelsByMake";
ccdModel.TargetControlID = ddlModel.ID;
ccdYear.ParentControlID = ddlModel.ID;
ccdYear.ServiceMethod = "GetYearsByMakeAndModel";
ccdYear.TargetControlID = ddlYear.ID;
break;
}
}
When the drop down displays, it should display a "Choose Year:" item (the value of the ) and then the years 2011-1983. It displays "Choose Year:" and then [Method Error 500].
What am I doing wrong? How does our server need to be configured to allow this?
I've tried adding the text
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
to the web.config but this makes the whole site break with a 500 - Internal Server Error. What are we doing wrong? We've tried everything and this has been going on for a week.
Any hints would be greatly appreciated.