CTP Migration Issue

Last post 02-27-2007 4:08 PM by sbrauen. 10 replies.

Sort Posts:

  • CTP Migration Issue

    02-21-2007, 5:06 PM
    • Loading...
    • sbrauen
    • Joined on 12-13-2006, 4:42 PM
    • Houston, TX
    • Posts 32

    I've recently migrated one of my business apps from the Atlas CTP to AJAX 1.0.  After making all of the changes necessary to get the site to correctly compile and run I thought I was done, but instead have run into an unexpected problem with the CascadingDropDown control.  So far, with regards to the CDD controls I have done the following:

    • Changed the CDD tags to be individual control entities instead of children to a single parent.
      old:
      <atlasToolkit:CascadingDropDown ID="cddActivity" runat="server" SuppressValidationScript="true">
        <atlasToolkit:CascadingDropDownProperties TargetControlID="PERFORMANCE_UNIT" ParentControlID="BUSINESS_UNIT" PromptText=" " ServiceMethod="GetPerformanceUnitsForBU" LoadingText="<%$ Resources:Resource, CCDDLoadingText %>" ServicePath="~/services/RefTables.asmx" Category="PERFORMANCE_UNIT" />
      new:
      <cc1:CascadingDropDown ID="cddActivity3" runat="server" TargetControlID="PERFORMANCE_UNIT" ParentControlID="BUSINESS_UNIT" PromptText=" " ServiceMethod="GetPerformanceUnitsForBU" LoadingText="<%$ Resources:Resource, CCDDLoadingText %>" ServicePath="~/services/RefTables.asmx" Category="PERFORMANCE_UNIT" />
    • I have added the "[System.Web.Script.Services.ScriptService()]" tag to the ASMX file referenced in the ServicePath.
    • I have added the "<jsonSerialization maxJsonLength="20" />" tag to the web.config file as suggested in other posts.

     If it helps the function referenced in the ASMX file looks like this:
    [WebMethod]
    public CascadingDropDownNameValue[] GetPerformanceUnitsForBU( string knownCategoryValues, string category)
    {
    StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString( knownCategoryValues);
        
    if (!kv.ContainsKey("BU")) return null;
      
    string parentKey = kv["BU"];

     
    return GatherList(parentKey, new REF_PERFORMANCE_UNITTableAdapter()).ToArray();
    }

    private List<CascadingDropDownNameValue> GatherList(string parentKey, object ta)
    {
    string[] param = new string[1];
        param[0] =
    "%" + parentKey + "%";
     
    Type type = ta.GetType();
      System.Reflection.
    MethodInfo method = type.GetMethod("GetDataByParent");
     
    DataTable dt = (DataTable)method.Invoke(ta, param);
     
    List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();

     
    for(int i = 0; i < dt.Rows.Count; i++) { values.Add(new CascadingDropDownNameValue((string)dt.Rows[i]["DESCRIPTION"], dt.Rows[i]["KEY"].ToString()));}

     
    return values;
    }

    Now, I know this works because it did so with the Atlas CTP, but now it doesn't.  So... Can anyone spot the boneheaded mistake I made?  I know I must have missed something, but for the life of me I can't see it.

    Thanks,
    Sean

  • Re: CTP Migration Issue

    02-21-2007, 11:06 PM
    • Loading...
    • mhallin
    • Joined on 01-24-2007, 11:55 PM
    • Sydney, Australia
    • Posts 56

    Hi Sean,

    This might be a silly/stupid question but do you got the AjaxControlToolkit.dll in your BIN directory and have you registred the assembly?  

    <%

    @ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    Kind regards

    Mikael
  • Re: CTP Migration Issue

    02-22-2007, 9:50 AM
    • Loading...
    • sbrauen
    • Joined on 12-13-2006, 4:42 PM
    • Houston, TX
    • Posts 32

    Yes on both accounts. 

    Right now the CascadingDropDowns are in an ASCX file and the Toolkit is registered on that page.  On a whim I tried registering the Toolkit in the parent ASPX page as well, but it had no effect.

  • Re: CTP Migration Issue

    02-26-2007, 11:39 AM
    • Loading...
    • sbrauen
    • Joined on 12-13-2006, 4:42 PM
    • Houston, TX
    • Posts 32
    Kicking this back up a few notches to see if anyone has any new ideas.
  • Re: CTP Migration Issue

    02-26-2007, 2:38 PM
    • Loading...
    • sbrauen
    • Joined on 12-13-2006, 4:42 PM
    • Houston, TX
    • Posts 32

    In my continuing fight to whittle down potential problems until I find the answer to this stupid problem here is my latest find:

    The web service code does run and does return the correct values.

    After trolling the forums some more I found I could set the .ASMX file as the start page and run each of the public methods while debugging the code.  I ran through each of the methods available to me and every one of them returned the correct values when prompted.

    I'm really at a loss at where to go from here.  Prior to doing this, based on other posts, I was sure the problem was with the .ASMX, but now I'm not sure.  If anyone has any good ideas or thoughts I'm all ears.

  • Re: CTP Migration Issue

    02-26-2007, 3:10 PM
    • Loading...
    • Steve Marx
    • Joined on 05-26-2006, 4:35 PM
    • Microsoft
    • Posts 643

    Try downloading Nikhil's Web Development Helper (http://projects.nikhilk.net/Projects/WebDevHelper.aspx) and see if there are any errors in the HTTP traffic.

    Steve Marx | ASP.NET AJAX Evangelist | Microsoft Corporation
  • Re: CTP Migration Issue

    02-26-2007, 5:06 PM
    Answer
    • Loading...
    • sbrauen
    • Joined on 12-13-2006, 4:42 PM
    • Houston, TX
    • Posts 32

    Steve,

    Thanks for the idea; I've had several other people tell me I need to download that tool in the past.  Unfortunately, it didn't seem to point to any major time lags in the application.  In fact I managed to get all but one of the CDD controls working by removing the jsonSerialization entry in the system.web.extensions portion of the web.config file.

    At the moment the one control that is not working is causing some sort of script time out to occur on the page.  I can comment all the code I want related to the CDD controls without any affect, but if I comment out the control itself the page loads fine with no time out.

    I've double checked all of the control's properties and they are correct.  Also, I've tried to run the WebDevHelper tool with the control enabled to see if it can spot the time out, but no luck there either.

  • Re: CTP Migration Issue

    02-26-2007, 5:27 PM
    • Loading...
    • Steve Marx
    • Joined on 05-26-2006, 4:35 PM
    • Microsoft
    • Posts 643

    Hmm, if this is a timeout, could I ask about the size of the data you're returning?  If it's very large, does the problem go away if you artificially restrict the amount of data returned?

    Steve Marx | ASP.NET AJAX Evangelist | Microsoft Corporation
  • Re: CTP Migration Issue

    02-27-2007, 9:53 AM
    • Loading...
    • sbrauen
    • Joined on 12-13-2006, 4:42 PM
    • Houston, TX
    • Posts 32
    I wish it were that easy.  The table being queried for the control is a meta-data table with only 7 records in it.  Some of the other cascading controls on the page are pulling twice that data and are working fine.
  • Re: CTP Migration Issue

    02-27-2007, 12:14 PM
    • Loading...
    • sbrauen
    • Joined on 12-13-2006, 4:42 PM
    • Houston, TX
    • Posts 32

    And the confusion continues.  I've been tweaking the properties of the affected CDD control and now have these points to ponder on:

    Existing control that works:
    <cc1:CascadingDropDown ID="cddActivity2" runat="server" TargetControlID="ACTIVITY_STATUS" ParentControlID="BUSINESS_UNIT" PromptText=" " ServiceMethod="GetActivityStatusForBU" LoadingText="<%$ Resources:Resource, CCDDLoadingText %>" ServicePath="~/services/RefTables.asmx" Category="ACTIVITY_STATUS" />

    Existing control that times out:
    <cc1:CascadingDropDown ID="cddActivity9" runat="server" TargetControlID="SUB_EXPENSE_TYPE" ParentControlID="EXPENSE_TYPE" PromptText=" " ServiceMethod="GetSubExpenseTypesForExpenseTypes" LoadingText="<%$ Resources:Resource, CCDDLoadingText %>" ServicePath="~/services/RefTables.asmx" Category="SUB_EXPENSE_TYPE" />

    1. If I remove the parent control property and leave the existing service method the control times out.
      - timeout: <cc1:CascadingDropDown ID="cddActivity9" runat="server" TargetControlID="SUB_EXPENSE_TYPE" PromptText=" " ServiceMethod="GetSubExpenseTypesForExpenseTypes" LoadingText="<%$ Resources:Resource, CCDDLoadingText %>" ="~/services/RefTables.asmx" Category="SUB_EXPENSE_TYPE" />
    2. If I remove the parent control property and replace the service method with one from another control that works then the control works.
      - works:  <cc1:CascadingDropDown ID="cddActivity9" runat="server" TargetControlID="SUB_EXPENSE_TYPE" PromptText=" " ServiceMethod="GetActivityStatusForBU" LoadingText="<%$ Resources:Resource, CCDDLoadingText %>" ServicePath="~/services/RefTables.asmx" Category="SUB_EXPENSE_TYPE" />
    3. If I leave the existing parent control property and replace the service method with one from another control that works then the I still get the timeout.
      - timeout: <cc1:CascadingDropDown ID="cddActivity9" runat="server" TargetControlID="SUB_EXPENSE_TYPE" ParentControlID="EXPENSE_TYPE" PromptText=" " ServiceMethod="GetActivityStatusForBU" LoadingText="<%$ Resources:Resource, CCDDLoadingText %>" ServicePath="~/services/RefTables.asmx" Category="SUB_EXPENSE_TYPE" />

    4. If I replace both the parent control and service method with those from a different control that works then the affected control times out.
      - timeout:  <cc1:CascadingDropDown ID="cddActivity9" runat="server" TargetControlID="SUB_EXPENSE_TYPE" ParentControlID="BUSINESS_UNIT" PromptText=" " ServiceMethod="GetActivityStatusForBU" LoadingText="<%$ Resources:Resource, CCDDLoadingText %>" ServicePath="~/services/RefTables.asmx" Category="SUB_EXPENSE_TYPE" />

    Now am I the only one whose confused by these results?  I could understand it if the control never worked when the original properties were in place but the fact that the properties from a different control, that does work, didn't, has me banging my head against my desk.

  • Re: CTP Migration Issue

    02-27-2007, 4:08 PM
    • Loading...
    • sbrauen
    • Joined on 12-13-2006, 4:42 PM
    • Houston, TX
    • Posts 32
    Got the 500 error fixed, so I'm killing this thread in order to start a new one concerning the CDD script timeout.
Page 1 of 1 (11 items)
Microsoft Communities
Page view counter