JS error while using the AjaxDataControl dll

Last post 06-27-2009 3:54 PM by alejandroha. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 10-29-2008 6:05 AM

    • seenu115
    • Top 150 Contributor
    • Joined on 10-29-2008
    • Wannabe Slacker
    • Points 83

    JS error while using the AjaxDataControl dll

    Hi,

    Am using the ajaxdatacontrolls.dll in my project.

    I have sucessfully implemented. but some time am facing the problem after publishing the code.

     

    Here am getting this err..

        ''Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: baseType"

     

    Frequently am getting this error

    Filed under:
  •  Advertisement

    Featured Advertisement

     
  • 10-29-2008 8:14 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: JS error while using the AjaxDataControl dll

    Hello Seenu115,

    Can you post the relevant aspx markup and javascript?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 10-29-2008 8:25 AM In reply to

    • seenu115
    • Top 150 Contributor
    • Joined on 10-29-2008
    • Wannabe Slacker
    • Points 83

    Re: JS error while using the AjaxDataControl dll

    <%@ Page Language="C#" AutoEventWireup="true" Codebehind="ChangeOwnerShip.aspx.cs"
        ValidateRequest="false" Inherits="GEP.eContract.ChangeOwnerShip" MasterPageFile="~/eContract.Master" %>

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
    <%@ Register Assembly="AjaxDataControls" Namespace="AjaxDataControls" TagPrefix="AjaxData" %>
    <asp:Content ContentPlaceHolderID="eContractMain" ID="Content1" runat="server">

        <script type="text/javascript" src="<%=GEP.eContract.AppSettingsECW.BaseURL %>/Includes/Page/ChangeOwnerShip.js"></script>

        <script language="javascript" type="text/javascript">
        var txtContractTitle= '<%=txtTitle.ClientID%>';
        var txtOwnerName = '<%=txtOwnerName.ClientID%>';
        var ddlOwners = '<%=ddlOwners.ClientID%>';
        </script>
        <h1>
            <asp:Label ID="lblAlertTitle" runat="server" Text="<%$ Resources:strings, Owner_title %>"></asp:Label></h1>
        <asp:Panel ID="Panel" runat="server" >
            <table>
                <tr>
                    <td style="width: 12%">
                        <asp:Label ID="lblTitle" runat="server" Text="<%$ Resources:strings, lbContractTitle %>"></asp:Label>
                    </td>
                    <td style="width: 25%">
                        <asp:TextBox ID="txtTitle" runat="server" onkeypress="{if (event.keyCode==13) BindContract1();}">
                        </asp:TextBox>
                        <ajaxToolkit:AutoCompleteExtender runat="server" ID="AutoCompleteExtender1" TargetControlID="txtTitle"
                            ServicePath="../eContractWebService.asmx" ServiceMethod="GetAutoCompleteContractTitle" FirstRowSelected="true"  DelimiterCharacters=";," CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                            MinimumPrefixLength="2" EnableCaching="true" />
                    </td>
                    <td style="width: 12%">
                        <asp:Label ID="lblOwnerName" runat="server" Text="<%$ Resources:strings, OwnerChange_ownerName %>"></asp:Label>
                    </td>
                    <td style="width: 20%">
                        <asp:TextBox ID="txtOwnerName" runat="server" onkeypress="{if (event.keyCode==13) BindContract1();}">
                        </asp:TextBox>
                        <ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="txtOwnerName"
                            ServicePath="../eContractWebService.asmx" ServiceMethod="GetAutoCompleteOwner"
                            MinimumPrefixLength="1" EnableCaching="true" />
                    </td>
                    <td colspan="4" align="center">
                        <input id="btnSearch" class="btn" runat="server" type="button" value="Search" onclick="BLOCKED SCRIPTreturn BindContract1();" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <table class="lineItemtable" id="POtable" style="border-right: white 1px solid; border-top: white 1px solid;
            border-left: white 1px solid; width: 90%; border-bottom: white 1px solid; border-collapse: collapse"
            cellspacing="0" cellpadding="2" rules="rows">
            <tr>
                <td>
                    <div id="message" class="gridmessage">
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <AjaxData:GridView ID="TeamGrid" runat="server" CssClass="grid" CellSpacing="1" CellPadding="2"
                        DataKeyName="Contract_ID" RowDataBoundEvent="onRowDataBound" SortColumn="Contract_ID"
                        EnableViewState="true" SortOrder="Ascending" SortOrderAscendingImageUrl="~/Images/up.gif"
                        SortOrderDescendingImageUrl="~/Images/dn.gif" SortCommandEvent="onSortCommand">
                        <AlternatingRowStyle CssClass="gridAltRow" />
                        <RowStyle CssClass="RowStyle" />
                        <HeaderStyle CssClass="gridHeader" />
                        <SelectedRowStyle CssClass="gridSelectedRow" />
                        <Columns>
                            <AjaxData:GridViewTemplateColumn HeaderText="Category" HeaderStyle-HorizontalAlign="Left"
                                ItemStyle-HorizontalAlign="Left" HeaderStyle-Wrap="false">
                                <HeaderTemplate>
                                    <input type="Checkbox" id="chkAll" onclick='selectContractAll(this)' />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <input type="Checkbox" id="chk" onclick='selectContract(this)' />
                                </ItemTemplate>
                            </AjaxData:GridViewTemplateColumn>
                            <AjaxData:GridViewBoundColumn DataField="Contract_Title" HeaderText="<%$ Resources:strings, ContractSearch_grid_Title %>"
                                ControlStyle-Width="90px" AllowDragAndDrop="True" SortField="Contract_Title" />
                            <AjaxData:GridViewBoundColumn DataField="Contract_No" HeaderText="<%$ Resources:strings, ContractSearch_grid_Number %>"
                                ControlStyle-Width="65px" AllowDragAndDrop="True" SortField="Contract_No" />
                            <AjaxData:GridViewBoundColumn DataField="Contract_Type" HeaderText="<%$ Resources:strings, ContractSearch_grid_Type %>"
                                ControlStyle-Width="50px" AllowDragAndDrop="True" SortField="Contract_Type" />
                            <AjaxData:GridViewBoundColumn DataField="ProductAndServicesCategory" HeaderText="<%$ Resources:strings, ContractSearch_grid_Category %>"
                                AllowDragAndDrop="True" SortField="ProductServiceCategory" />
                            <AjaxData:GridViewBoundColumn DataField="Contract_CreatedOn" HeaderText="<%$ Resources:strings, ContractSearch_grid_CreatedDate %>"
                                ControlStyle-Width="90px" AllowDragAndDrop="True" SortField="Contract_CreatedOn" />
                            <AjaxData:GridViewBoundColumn DataField="Owner" HeaderText="<%$ Resources:strings, ContractSearch_grid_Owner %>"
                                AllowDragAndDrop="True" ControlStyle-Width="80px" SortField="Owner_Name" />
                            <AjaxData:GridViewBoundColumn DataField="Contract_Status" HeaderText="<%$ Resources:strings, ContractSearch_grid_Status %>"
                                AllowDragAndDrop="True" SortField="Contract_Status" />
                        </Columns>
                    </AjaxData:GridView>
                    <AjaxData:Pager ID="TeamPager" runat="server" CssClass="PagerRowStyleGrid" CurrentPageStyle-CssClass="PagerCurrentPageGrid"
                        OtherPageStyle-CssClass="PagerOtherPageGrid" CurrentPageStyle-Width="50%" InfoStyle-CssClass="pagerInfo"
                        SliderSize="8" PageChangedEvent="pageChanged" PageSize="10" EnableViewState="true">
                    </AjaxData:Pager>
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="<%$ Resources:strings, changeOwner_selectOwnertitle %>"></asp:Label>
                </td>
                <td>
                    &nbsp;<asp:DropDownList ID="ddlOwners" runat="server" Width="150px">
                    </asp:DropDownList>
                    <ajaxToolkit:AutoCompleteExtender runat="server" ID="AutoCompleteExtender2" TargetControlID="txtChngOwner"
                        ServicePath="../eContractWebService.asmx" ServiceMethod="GetAutoCompleteOwner" FirstRowSelected="true"  DelimiterCharacters=";," CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                        MinimumPrefixLength="1" EnableCaching="true" />
                </td>
                <td colspan="4" align="center">
                    <input id="btnChangeOwner" class="btn" type="button" value="Change Owner" onclick="BLOCKED SCRIPTreturn ChangeOwner();" />
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:TextBox ID="txtChngOwner" Visible="false" runat="server">
                    </asp:TextBox></td>
                <td align="center" colspan="4">
                </td>
            </tr>
        </table>
    </asp:Content>

     

     

    JavaScript File

            var _message;
            var _pager;
            var _contract;
            var counter = null;
            var mode;
            var excludes;
            var iChk=0;
            var arrCheck=new Array();
            var k=0;
            var arrAllCheck=new Array();
            var chkCount = 10;
            function pageLoad()
            {
                // Getting the reference of the Client Components and attaching the event handlers
            try
            {
                _TeamGrid = TeamGrid;
                _Teampager = TeamPager;
                _message = $get('message');
                divColumns = $get('divCol');
                LoadTeamMembers();
            }
            catch(err)
            {
                alert(err.message);
            }          
            return false;
            }       
           
            function BindContract1()
            {    
                ChkIds = new Array();
                ChkValue = new Array();
                counter = 0;
                LoadTeamMembers();
            }
           
            function selectAllContract(obj)
            {   

            }
            var count =0;
           
            function getCheckedCount()
            {
               
                for(var i = 0; i<ChkIds.length; i++)
                {
                    if(document.getElementById(ChkIdsIdea).checked == true)
                    {
                        count++;
                    }
                }
            }
            function selectContract(obj)
            {
               
                var flag = false;
                count = 0;
                getCheckedCount();
                if(obj.checked)
                { 
                   arrCheck.push(obj.name);
                }
                else
                {
                   arrCheck.remove(obj.name);
                   flag = true;
                }
                if( flag == true)
                {
                    document.getElementById(chkAll.id).checked = false;
                }
               
                if(ChkIds.length == count)
                {
                    document.getElementById(chkAll.id).checked = true;
                }
            }
           
            Array.prototype.remove=function(s){
              for(i=0;i<this .length;i++){
                if(s==thisIdea) this.splice(i, 1);
              }
            }       
           
            function selectContractAll(obj)
            {
                arrCheck = new Array();
                var length = ChkIds.length;
                if(obj.checked)
                {
                    for(var i = 0; i<ChkIds.length; i++)
                    {
                        var val = document.getElementById(ChkIdsIdea).name;
                        arrCheck.push(val);
                        document.getElementById(ChkIdsIdea).checked = true;
                    }
                }
                else
                {
                    for(var i = 0; i<ChkIds.length; i++)
                    {
                        var val = document.getElementById(ChkIdsIdea).name;
                        arrCheck.remove(val);
                        document.getElementById(ChkIdsIdea).checked = false;
                    }
                }
            }      
                   
    // Page Load Method in JS
    var _TeamGrid = null;
    var _Teampager = null;

    function LoadTeamMembers()
    {
        var sortColumn = _TeamGrid.get_sortColumn();
        var sortOrder = (_TeamGrid.get_sortOrder() == AjaxDataControls.GridViewSortOrder.Descending) ? 'ASC' : 'DESC';
        var startIndex = (_Teampager.get_pageIndex() * _Teampager.get_pageSize());
        var strContractName = document.getElementById(txtContractTitle).value;
        var searchOwnerName = document.getElementById(txtOwnerName).value;
        _message.innerHTML = '<div><img alt=\"\" src=\"../Images/loading-circ.gif\"/>&nbsp;' + varPageLoadMsg + '</div>';
        _message.style.display = '';   
        eContractPagingService.getSearchResultsPagingOwner(strContractName,searchOwnerName,sortColumn,sortOrder,startIndex,_Teampager.get_pageSize(),onLoadSuccess)
    }
    function onLoadSuccess(result)
    {
        _teammembers = null;
        if(result != null)
        {
        _teammembers = result.Rows;
        _Teampager.set_recordCount(result.Total);
        }
        else
        {
        _Teampager.set_recordCount(0);
        }
       
        _message.innerHTML = '';
        _message.style.display = 'none';
        bindTeamMembers();
    }

    function bindTeamMembers()
    {
        if(_teammembers == null)
            _TeamGrid._emptyDataText = varmsgNoRecordFound;
       
        _TeamGrid.set_dataSource(_teammembers);
        _TeamGrid.dataBind();
    }
    function pageChanged(sender, e)
    {
        ChkIds = new Array();
        ChkValue = new Array();
        counter = 0;
        _Teampager.set_pageIndex(e.get_newPageIndex());
        LoadTeamMembers();
    }

    var ChkIds = new Array();
    var ChkValue = new Array();
    var chkAll =  null;
    var counter = 0;

    //Grid Row DataBound Event
    function onRowDataBound(sender, e)
    {
        var row = e.get_row();
        if(row._rowType == AjaxDataControls.GridViewRowType.Header)
        {
            chkAll = row.findControl('chkAll');
        }
       
        if (row.get_isDataRowType())
        {
            var product = row.get_dataItem();
            row.get_container().onmouseover=(this, "onmouseover", selectRow);
            row.get_container().onmouseout=(this, "onmouseout", unSelectRow);

            if( product.Contract_Title.length > 30)
            {
                product.Contract_Title = product.Contract_Title.substring(0,30) + "..";
                var FNameIndex = _TeamGrid.getColumnIndexByHeaderText(varContractSearch_grid_Title);
                var FName = row.get_container().childNodes[FNameIndex].childNodes[0];
                FName.data = product.Contract_Title;
                FName.nodeValue = product.Contract_Title;
            }
            var chk = row.findControl('chk');
            if(chk!=null)
            {
                chk.value = row._dataItem.Contract_ID;
                var CidOwnr = chk.value + "," + row._dataItem.Owner_ID;
                chk.name =  chk.value + "," + row._dataItem.Owner_ID;
                ChkIds[counter] = chk.id;
                ChkValue[counter] = CidOwnr;
                counter++;
            }
        }
    }
    function onSortCommand(sender, e)
    {
        ChkIds = new Array();
        ChkValue = new Array();
        counter = 0;
        _TeamGrid.set_sortColumn(e.get_sortColumn())
        _TeamGrid.set_sortOrder(e.get_sortOrder());
        _Teampager.set_pageIndex(0); // need to reset the current page as sorting is changed
        _TeamGrid.set_editIndex(-1);
        LoadTeamMembers();
    }
    //Load Search Users
    function LoadSearchUsers()
    {
        _Teampager._pageIndex = 0;
        LoadTeamMembers();
        return false;
    }
    function unSelectRow()
    {
        this.style.backgroundColor='';
    }
    function selectRow()
    {
        this.style.backgroundColor = '#d4dcd0';
    }


     

    Filed under:
  • 10-29-2008 8:30 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: JS error while using the AjaxDataControl dll

    Do you know when the error occurs? Does it show a line number?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 10-29-2008 8:45 AM In reply to

    • seenu115
    • Top 150 Contributor
    • Joined on 10-29-2008
    • Wannabe Slacker
    • Points 83

    Re: JS error while using the AjaxDataControl dll

     

    HI,

    Its not happening in the local machine but when the code is published this error is happened..

    one more intresting thing is everytime am not getting this error. It will happen some times only

     

    LIne NO: 2826

    Char : 9

    Error: ''Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: baseType"

    Code: 0

     

    Filed under:
  • 10-29-2008 8:50 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: JS error while using the AjaxDataControl dll

    Thats tough to solve. I would try to create a very basic simple example with just the ADC Gridview and try to get that working on the live server and slowly add the parts that are in your current page. Unfortunately I do not see any other way to solve this.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 10-29-2008 8:51 AM In reply to

    • seenu115
    • Top 150 Contributor
    • Joined on 10-29-2008
    • Wannabe Slacker
    • Points 83

    Re: JS error while using the AjaxDataControl dll

    When am debugging it is showing error in the ScriptManager Resource.axd file

     

     

  • 10-29-2008 8:59 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: JS error while using the AjaxDataControl dll

    Try to comment out the code in the onRowDataBound and see if that solves it.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 10-29-2008 10:01 AM In reply to

    • seenu115
    • Top 150 Contributor
    • Joined on 10-29-2008
    • Wannabe Slacker
    • Points 83

    Re: JS error while using the AjaxDataControl dll

    Just now i debugged.

     

    function Type$registerClass(typeName, baseType, interfaceTypes) {

     

    Here am getting typename : GridViewTemplateColumn

    and baseType: undefined,

    and interfacetypes: undefined

  • 10-29-2008 10:09 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: JS error while using the AjaxDataControl dll

    The only template that you are using is:

    <ItemTemplate>
      <input type="Checkbox" id="chk" onclick='selectContract(this)' />
    </ItemTemplate>

    Try to remove that just to see if that makes the page work. I suspect that your ItemDataBound is making problems. Have you tried to comment out the ItemDataBound code completely to see if that solves it?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 10-29-2008 10:53 AM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 19,057

    Re: JS error while using the AjaxDataControl dll

     this guy has a blog post about the similar problem

    http://danhounshell.com/blogs/dan/archive/2007/03/21/sys-argumentundefinedexception-value-cannot-be-undefined-parameter-name-id.aspx

    according to him, it has to do some validator dlls. Anyway, check it out, and see it helps. In the mean time, I will search around for you too.

  • 10-29-2008 11:05 AM In reply to

    • seenu115
    • Top 150 Contributor
    • Joined on 10-29-2008
    • Wannabe Slacker
    • Points 83

    Re: JS error while using the AjaxDataControl dll

    ya ..

    I removed the item command still am getting the same error..

  • 10-30-2008 7:19 AM In reply to

    • seenu115
    • Top 150 Contributor
    • Joined on 10-29-2008
    • Wannabe Slacker
    • Points 83

    Re: JS error while using the AjaxDataControl dll

    hi

    I applied vallidators.dll

    still am gettin error..

     

    Its working fine in my local machine. but once the code is deployed then only am facing the error. that error is not happening in all the systems.

     

    Is there any related to system configuration...?

  • 10-30-2008 8:20 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: JS error while using the AjaxDataControl dll

    Are you using the same asp.net ajax version on the server?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 10-30-2008 8:40 AM In reply to

    • seenu115
    • Top 150 Contributor
    • Joined on 10-29-2008
    • Wannabe Slacker
    • Points 83

    Re: JS error while using the AjaxDataControl dll

    hi,

    am using the same version on the server also.

     

    Previously i have used Ajax.Controls (Older version) and it is working perfectly with out any issues...

    but am facing issues with new ajaxdatacontrol.dll

    If am missing any thing except ajaxdatacontrol.dll.

Page 1 of 2 (16 items) 1 2 Next >