This is a migrated thread and some comments may be shown as answers.

Upgrading problems to vs2010 and .Net4

4 Answers 126 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 18 Jun 2012, 08:11 PM
Hello, I have an old application that was written in vs2008 using .Net3.5. After I migrated the application to vs2010 and .Net4 some of my telerik controls stopped working. Mainly I find the RadAjaxManager is not working. Looking at the version it's 1.0.3.0, all the way back to 2006. Is there any compatibility issues I'm potentially running into? 

More about this issue. I'm able to user the RadAjaxManager in design mode, but they don't fire once the application is running. When I remove the RadAjaxManager everything works fine, but the whole page keep up updating as opposed to the single control.

Any help will be much appreciated.
Tom

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Jun 2012, 04:24 PM
Hi Tom,

Could you please elaborate a bit more on your scenario? Also it will be helpful if you post your aspx page markup with the related code behind file or send us a small runnable example which demonstrates the described issue. Thus we will be able to gather more details about your scenario, debug the application and investigate the problem.

Otherwise it will be hard to determine what is causing the described problem based on the provided information.


Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Tomasz
Top achievements
Rank 1
answered on 21 Jun 2012, 05:15 PM
Hello Pavlina

When my search page loads it shows that it loaded with errors, when I look at the javascript errors I see the below.

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.3; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E; MS-RTC LM 8; MS-RTC EA 2)
Timestamp: Thu, 21 Jun 2012 17:08:03 UTC
Message: Expected ')'
Line: 328
Char: 21
Code: 0
URI: http://172.19.1.64:9090/Search.aspx
Message: Expected ')'
Line: 346
Char: 21
Code: 0
URI: http://172.19.1.64:9090/Search.aspx


When I look at the Source I see the following under Line 328 that errors
<select name="SubGroup" onchange="javascript:setTimeout(&#39;window['SearchAjaxManager'].AsyncRequest(\&#39;SubGroup\&#39;,\&#39;\&#39;)&#39;, 0)" id="SubGroup" style="width:215px;">

Doing some digging got me to the point where I'm probably using older telerik assemblies that were written for .Net2 and I'm currently on .Net4. 

I've looked at upgrading to the newest controls and downloaded the latest trial, but that process does not to be a smooth one as well, while the JavaScript errors went away, and some of the controls do fire, others don't. I'm at the point where I'm debating if the new Telerik controls will fix my issue or should I just rip the old ones out and do it the old fashion way. Any help and suggestions will be much appreciated.

Below is my markup and code behind. 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search"
    Title="ECAF - Cosma International" %>
 
<%@ Register Assembly="Infragistics2.WebUI.WebDateChooser.v6.2, Version=6.2.20062.34, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.WebSchedule" TagPrefix="igsch" %>
<%@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="radW" %>
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %>
<%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>
<%@ Register Assembly="RadMenu.Net2" Namespace="Telerik.WebControls" TagPrefix="radM" %>
<html>
<head id="Head1" runat="server">
    <link href="CSS/Main.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="ECAFForm" runat="server" enctype="multipart/form-data" onsubmit="javascript:LoadingWait('Loading Information');">
        <div id="Contents" >
            <div id="Subheader" style="width: 100%">
                <table border="0" cellspacing="0" width="100%">
                    <tr>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr>
                                    <td>
                                         </td>
                                </tr>
                                <tr>
                                    <td>
                                        <radM:RadMenu ID="ECAFMenu" Skin="Telerik" runat="server">
                                            <Items>
                                                <radM:RadMenuItem ID="menuDefault" runat="server" Text="Home" NavigateUrl="Default.aspx">
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="menuNew" runat="server" Text="New">
                                                    <Items>
                                                        <radM:RadMenuItem ID="RadMenuItem3" runat="server" Text="ECAF" NavigateUrl="NewEcaf.aspx">
                                                        </radM:RadMenuItem>
                                                        <radM:RadMenuItem ID="RadMenuItem4" runat="server" Text="ECAF from Archive" NavigateUrl="Archive.aspx">
                                                        </radM:RadMenuItem>
                                                        <radM:RadMenuItem ID="RadMenuItem5" runat="server" Text="Contract" NavigateUrl="Search.aspx?FromContract=1" Visible="false">
                                                        </radM:RadMenuItem>
                                                    </Items>
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="RadMenuItem6" runat="server" Text="Search" NavigateUrl="Search.aspx">
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="menuReports" runat="server" Text="Reports" NavigateUrl="Reports.aspx" >
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="menuAdministartion" runat="server" NavigateUrl="Administration.aspx"
                                                    Text="Administration">
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="menuArchived" runat="server" Text="Archived" NavigateUrl="Archive.aspx">
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="menuCanceled" runat="server" Text="Cancelled" NavigateUrl="Canceled.aspx">
                                                </radM:RadMenuItem>
                                                 <radM:RadMenuItem ID="menuDeleted" runat="server" Text="Recycle Bin" NavigateUrl="Deleted.aspx">
                                            </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="menuStatistics" runat="server" Text="Statistics" NavigateUrl="Statistics.aspx">
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="RadMenuItem9" runat="server" Text="Shared Documents" NavigateUrl="PublicAttachments.aspx">
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="RadMenuItem1" runat="server" Text="Workflow Rules" NavigateUrl="WorkflowRules.aspx">
                                                </radM:RadMenuItem>
                                                <radM:RadMenuItem ID="RadMenuItem10" runat="server" ForeColor="White" Text="." Width="100%">
                                                </radM:RadMenuItem>
                                            </Items>
                                        </radM:RadMenu>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                         </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="Content">
                <table border="0" cellpadding="0" cellspacing="5" style="width: 100%">
                    <tr>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr>
                                    <td rowspan="2" style="width: 80px" valign="top">
                                        <asp:Label ID="Label110" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="#CC3300"
                                            Text="search"></asp:Label></td>
                                    <td>
                                         </td>
                                </tr>
                                <tr>
                                    <td style="background-image: url(Images/topLine.gif); background-repeat: repeat-x;
                                        height: 18px">
                                             
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table border="0" cellpadding="3" cellspacing="1" class="ECAFTableList" style="width: 100%">
                                <tr>
                                    <td class="Label">
                                        <asp:Label ID="Label1" runat="server" Text="First Name:"></asp:Label></td>
                                    <td class="Body">
                                        <asp:TextBox ID="FirstName" runat="server" Width="215px"></asp:TextBox></td>
                                    <td class="Label">
                                        <asp:Label ID="Label8" runat="server" Text="Last Name:"></asp:Label></td>
                                    <td class="Body">
                                        <asp:TextBox ID="LastName" runat="server" Width="215px"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td class="Label">
                                        <asp:Label ID="Label2" runat="server" Text="Start Date (From):"></asp:Label></td>
                                    <td class="Body">
                                        <igsch:WebDateChooser ID="StartDateFrom" runat="server" Width="215px" MaxDate="2099-01-01"
                                            MinDate="1900-01-01" NullDateLabel="">
                                            <CalendarLayout DayNameFormat="FirstLetter" ShowFooter="False" FooterFormat="" ShowNextPrevMonth="False"
                                                ShowTitle="False" Culture="English (Canada)">
                                                <SelectedDayStyle BackColor="#0054E3" />
                                                <DayStyle BackColor="White" Font-Names="Arial" Font-Size="9pt" />
                                                <OtherMonthDayStyle ForeColor="#ACA899" />
                                                <DayHeaderStyle BackColor="#7A96DF" ForeColor="White" />
                                                <TitleStyle BackColor="#9EBEF5" />
                                                <CalendarStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                    Font-Underline="False">
                                                </CalendarStyle>
                                            </CalendarLayout>
                                        </igsch:WebDateChooser>
                                    </td>
                                    <td class="Label">
                                        <asp:Label ID="Label9" runat="server" Text="Start Date (To):"></asp:Label></td>
                                    <td class="Body">
                                        <igsch:WebDateChooser ID="StartDateTo" runat="server" Width="215px" MaxDate="2099-01-01"
                                            MinDate="1900-01-01" NullDateLabel="">
                                            <CalendarLayout DayNameFormat="FirstLetter" ShowFooter="False" FooterFormat="" ShowNextPrevMonth="False"
                                                ShowTitle="False" Culture="English (Canada)">
                                                <SelectedDayStyle BackColor="#0054E3" />
                                                <DayStyle BackColor="White" Font-Names="Arial" Font-Size="9pt" />
                                                <OtherMonthDayStyle ForeColor="#ACA899" />
                                                <DayHeaderStyle BackColor="#7A96DF" ForeColor="White" />
                                                <TitleStyle BackColor="#9EBEF5" />
                                                <CalendarStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                    Font-Underline="False">
                                                </CalendarStyle>
                                            </CalendarLayout>
                                        </igsch:WebDateChooser>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="Label">
                                        <asp:Label ID="Label7" runat="server" Text="Group:"></asp:Label></td>
                                    <td class="Body">
                                        <asp:DropDownList ID="SubGroup" runat="server" Width="215px" AutoPostBack="True"
                                            OnSelectedIndexChanged="SubGroup_SelectedIndexChanged">
                                        </asp:DropDownList></td>
                                    <td class="label">
                                        <asp:Label ID="Label5" runat="server" Text="Division:"></asp:Label></td>
                                    <td class="body">
                                        <asp:DropDownList ID="Division" runat="server" Width="215px" AutoPostBack="True"
                                            onselectedindexchanged="Division_SelectedIndexChanged">
                                        </asp:DropDownList></td>
                                </tr>
                                <tr>
                                    <td style="height: 21px" class="Label">
                                        <asp:Label ID="Label4" runat="server" Text="Prepared By:"></asp:Label></td>
                                    <td style="height: 21px" class="Body">
                                        <asp:DropDownList ID="PreparedBy" runat="server" Width="215px">
                                        </asp:DropDownList></td>
                                    <td style="height: 21px" class="Label">
                                        <asp:Label ID="Label3" runat="server" Text="Status:"></asp:Label></td>
                                    <td style="height: 21px" class="body">
                                        <asp:DropDownList ID="Status" runat="server" Width="215px">
                                            <asp:ListItem Value="0">Select One...</asp:ListItem>
                                            <asp:ListItem Value="1">Draft</asp:ListItem>
                                            <asp:ListItem Value="2">InProcess</asp:ListItem>
                                            <asp:ListItem Value="32">Under Review</asp:ListItem>
                                            <asp:ListItem Value="4">Internal Approved</asp:ListItem>
                                            <asp:ListItem Value="8">Approved</asp:ListItem>
                                            <asp:ListItem Value="16">Archived</asp:ListItem>
                                        </asp:DropDownList></td>
                                </tr>
                                <tr>
                                    <td class="Label">
                                        <asp:Label ID="Label10" runat="server" Text="Position:"></asp:Label></td>
                                    <td class="Body">
                                        <asp:DropDownList ID="Position" runat="server" Width="215px">
                                        </asp:DropDownList></td>
                                    <td class="Body">
                                    </td>
                                    <td class="Body">
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                         </td>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                    <td align="right">
                                        <asp:Button ID="SearchBtn" runat="server" Text="Search" Width="129px" OnClick="SearchBtn_Click"
                                            CssClass="shadowButton" /></td>
                                </tr>
                            </table>
                            <radA:RadAjaxManager ID="SearchAjaxManager" runat="server">
                                <AjaxSettings>
                                    <radA:AjaxSetting AjaxControlID="SubGroup">
                                        <UpdatedControls>
                                            <radA:AjaxUpdatedControl ControlID="Division" LoadingPanelID="SearchLoadingPanel" />
                                            <radA:AjaxUpdatedControl ControlID="PreparedBy" LoadingPanelID="SearchLoadingPanel" />
                                        </UpdatedControls>
                                    </radA:AjaxSetting>
                                    <radA:AjaxSetting AjaxControlID="Division">
                                        <UpdatedControls>
                                            <radA:AjaxUpdatedControl ControlID="PreparedBy" LoadingPanelID="SearchLoadingPanel" />
                                        </UpdatedControls>
                                    </radA:AjaxSetting>
                                </AjaxSettings>
                            </radA:RadAjaxManager>
                            <radA:AjaxLoadingPanel ID="SearchLoadingPanel" runat="server" Height="14px" Width="70px">
                                <img alt="loading..." src="RadControls/Ajax/Skins/Default/loading7.gif" />
                            </radA:AjaxLoadingPanel>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="Footer">
            <div id="FooterLeft">
            </div>
            <div id="FooterRight">
                All Contents  2006. Cosma International.</div>
        </div>
 
        <script type="text/javascript">
            document.body.scroll="no";
        </script>
 
    </form>
</body>
</html>

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Cosma.ECAF.Interface;
 
public partial class Search : ECAFPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MenuSetup();
 
        if (!this.IsPostBack)
        {
            User userInfo = (User)Session["user"];
            IList subgroups = Facade.GetSubGroups(userInfo,false);
            if (subgroups.Count > 0)
            {
                SubGroup.DataTextField = "Value";
                SubGroup.DataValueField = "Key";
                SubGroup.DataSource = subgroups;
                SubGroup.DataBind();
                if (subgroups.Count > 1)
                {
                    SubGroup.Enabled = true;
                    SubGroup.Items.Insert(0, new ListItem("Select One...", "0"));
                    PreparedBy.Items.Insert(0, new ListItem("Select a SubGroup...", "0"));
                    Division.Items.Insert(0, new ListItem("Select a SubGroup...", "0"));
                }
                else //an only SubGroup
                {
                    OnSubGroupChanged();
                    SubGroup.Enabled = false;
                }
            }
 
            Position.DataTextField = "Value";
            Position.DataValueField = "Value";
            Position.DataSource = Facade.GetPositions();
            Position.DataBind();
            Position.Items.Insert(0, new ListItem("Select One...", "0"));
 
            if (FromArchive == 1)
            {
                Status.SelectedIndex = 6;
                Status.Enabled = false;
            }
        }
    }
 
    protected void MenuSetup()
    {
        //-- user should have at least 1 role available
        User userInfo = (User)Session["user"];
        if (userInfo.Roles.Count > 0)
        {
 
            if (!userInfo.IsAdministrator)
            {
                menuAdministartion.Visible = menuStatistics.Visible = false;
                menuNew.Visible = (userInfo.IsAssistant || userInfo.IsCoordinator);
            }
        }
        else
            ECAFMenu.Visible = false;
    }
    protected void SearchBtn_Click(object sender, EventArgs e)
    {
        User userInfo = (User)Session["user"];
        DateTime DateFrom = (StartDateFrom.Value != null) ? ((DateTime)StartDateFrom.Value) : new DateTime(1980, 1, 1);
        DateTime DateTo = (StartDateTo.Value != null) ? ((DateTime)StartDateTo.Value) : new DateTime(2099, 1, 1);
 
        //--get filter for receiving all ECAFs user has an access to.
         
        SearchFilter defFilter = (SearchFilter)Session["MainSearchFilter"];
        if (defFilter == null)
        {
            defFilter = Facade.CreateFilter(userInfo, null, true);
            Session["MainSearchFilter"] = defFilter;
        }
 
        SearchFilter searchFilter = Facade.CreateFilter(userInfo, FirstName.Text, LastName.Text, DateFrom, DateTo,
            Convert.ToInt32(Status.SelectedValue),Convert.ToInt32(PreparedBy.SelectedValue),
            Convert.ToInt32(SubGroup.SelectedValue), Convert.ToInt32(Division.SelectedValue),
            Position.SelectedValue);
 
            if (Session["SearchFilters"] == null)
                Session.Add("SearchFilters", searchFilter);
            else
                Session["SearchFilters"] = searchFilter;
 
            if (FromContract == 1)
                Response.Redirect("Contracts.aspx");
            else if (FromArchive == 1)
                Response.Redirect("SearchResult.aspx?FromArchive=1");
            else
                Response.Redirect("SearchResult.aspx");
   
    }
 
     
    protected void SubGroup_SelectedIndexChanged(object sender, EventArgs e)
    {
        OnSubGroupChanged();
    }
 
     
    private void OnSubGroupChanged()
    {
        PreparedBy.DataTextField = "FullName";
        PreparedBy.DataValueField = "UserID";
        //get subgroup divisionID
        User userInfo = (User)Session["user"];
        int divisionID = Facade.GetDivisionId(userInfo, Convert.ToInt32(SubGroup.SelectedValue));
        //PreparedBy.DataSource = Facade.GetDivisionUsers(divisionID);
        PreparedBy.DataSource = Facade.GetDivisionUsersForSearch(Convert.ToInt32(SubGroup.SelectedValue), divisionID, userInfo);
        PreparedBy.DataBind();
        PreparedBy.Items.Insert(0, new ListItem("Select One...", "0"));
 
        Division.DataTextField = "Value";
        Division.DataValueField = "Key";
        Division.DataSource = Facade.GetDivisions(Convert.ToInt32(SubGroup.SelectedValue), userInfo);
        Division.DataBind();
        Division.Items.Insert(0, new ListItem("Select One...", "0"));
 
    }
 
    protected override bool CanAccess()
    {
        return true;
    }
    protected void Division_SelectedIndexChanged(object sender, EventArgs e)
    {
        PreparedBy.DataTextField = "FullName";
        PreparedBy.DataValueField = "UserID";
        User userInfo = (User)Session["user"];
         
        PreparedBy.DataSource = Facade.GetDivisionUsersForSearch(Convert.ToInt32(SubGroup.SelectedValue),
            Convert.ToInt32(Division.SelectedValue), userInfo);
        PreparedBy.DataBind();
        PreparedBy.Items.Insert(0, new ListItem("Select One...", "0"));
    }
}

0
Accepted
Pavlina
Telerik team
answered on 26 Jun 2012, 02:49 PM
Hi Tom,

Can you ensure that you are using the correct dll for framework 4.0? Also make sure that you have followed the instructions for migrating RadAjax control from this help topic.

All the best,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Varun
Top achievements
Rank 1
answered on 23 Apr 2013, 12:35 PM

Hi Tom,

Can you suggest how you resolved this isssue. I am facing the same problem. Also suggest which version radajax.net_.dll will work for .net 4.0 framework.


Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GIL 3; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; GIL3)
Timestamp: Tue, 23 Apr 2013 12:35:11 UTC

Message: Expected ')'
Line: 119
Char: 21
Code: 0
URI: http://etcergo-stage.chevron.com/Admin/ManageUsers.aspx?

Message: Expected ')'
Line: 142
Char: 21
Code: 0
URI: http://etcergo-stage.chevron.com/Admin/ManageUsers.aspx?

Thank you.
Regards,
Varun Prasad 

Tags
Ajax
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Tomasz
Top achievements
Rank 1
Varun
Top achievements
Rank 1
Share this question
or