0

Since i changed my website from .NET 4.0 to 3.5 ModalPopup is not working. The problem is there's no error message showing. So i can't figure out how to fix it. Has anyone had the same problem before?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:Button ID="btnpopup" runat="server" Text="Button" /> 

        <asp:ModalPopupExtender ID="mpe" runat="server" TargetControlID="btnpopup" PopupControlID="pnlpopup" 
            CancelControlID="btnCancelpopup" EnableViewState="true" DropShadow="true" />

            <asp:Panel ID="pnlpopup" runat="server" Width="400px">
                test
            <asp:Button ID="btnCancelpopup" runat="server" Text="Button" />
        </asp:Panel>
    </div>
    </form>
</body>
</html>
SiHyung Lee
  • 349
  • 3
  • 8
  • 25

1 Answers1

0

In short, I think the fastest solution to your problem is to create a new solution based on .NET 3.5, and move your files over.

I built two solutions, one in 3.5 and one in 4.0, installed the ajaxcontroltoolkit via the Nuget package manager for vs2010 (here, which also includes instrucs. for vs2008) and both ran your code correctly.

When I rolled back the 4.0 solution to 3.5, the error I received was:

"Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."

The dependency appears to be with System.Web.Extensions as the following error indicates:

Error 2 Assembly 'AjaxControlToolkit, Version=4.1.60501.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' uses 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

You may be able to fiddle around with the appropriate dependencies, but I personally wouldn't bother.

MTAdmin
  • 1,023
  • 3
  • 17
  • 36