Could not load file or assembly

Last post 07-02-2007 7:41 AM by paul.vencill. 1 replies.

Sort Posts:

  • Could not load file or assembly

    06-30-2007, 5:05 PM
    • Member
      197 point Member
    • blink18jew
    • Member since 05-22-2007, 12:12 AM
    • Posts 626

    Im attempting to have a page that`ll allow the user to dynamically create resizeable dragpanels.First step is to create dynamically createable dragpanels. Following this ( http://www.imaginativeuniversal.com/IIIASPNETAjaxDynamicDragAndDrop.aspx )

    I have a code that on clicking a button will generate a new panel 100 by 100px within my DIV area that is designed to contain the dragpanels.

    Javascript in the page head :   

      <script type="text/javascript">
        
        function createDraggableDiv() {
            var panel= document.createElement("div");

            panel.style.height="100px";
            panel.style.width="100px";
            panel.style.backgroundColor="Blue";

            var panelHandle = document.createElement("div");

            panelHandle.style.height="20px";
            panelHandle.style.width="auto";
            panelHandle.style.backgroundColor="Green";
            panel.appendChild(panelHandle);
            var target = $get('containerDiv').appendChild(panel);
            addFloatingBehavior(panel, panelHandle);
        }

            function addFloatingBehavior(ctrl, ctrlHandle){
                $create(Sys.Preview.UI.FloatingBehavior, {'handle': ctrlHandle}, null, null, ctrl);
            }
        
        
    </script>

    ASPX C# Code :  

    <asp:ScriptManager ID="ScriptManager1" runat="server">
                <Scripts>
                </Scripts>
    </asp:ScriptManager>


            <ajaxToolkit:DragPanelExtender ID="DragPanelExtender1" TargetControlID="Panel1" runat="server">
            </ajaxToolkit:DragPanelExtender>


    <input type="button" value="Add Floating Div" onclick="createDraggableDiv();" />
    <div id="containerDiv" style="background-color:Purple;height:800px;width:600px;"/></div>

    do make them dragable according to the tutorial i need to add 2 scripts in the ScriptManager : 

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    <Scripts>
            <asp:ScriptReference Name="Microsoft.Web.Resources.ScriptLibrary.PreviewScript.js" />
     <asp:ScriptReference Name="Microsoft.Web.Resources.ScriptLibrary.PreviewDragDrop.js" />
    </Scripts>
    </asp:ScriptManager>

    but when i add them to my page i get the following error :

    Assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource with name 'Microsoft.Web.Resources.ScriptLibrary.PreviewScript.js'.

    I went to C:/ProgramFiles/ Microsoft ASP.NET/ASP.NET 2.0 AJAX Extensions/v1.0.61025 and couldnt find the scripts, so my question is.... where do you get the two javascripts from? all help would be appricaiated! si!

  • Re: Could not load file or assembly

    07-02-2007, 7:41 AM
    Answer
    • Contributor
      6,620 point Contributor
    • paul.vencill
    • Member since 02-01-2006, 7:57 AM
    • Gaithersburg, MD
    • Posts 1,350

    That tutorial was written based on the pre-release version, the namespace, etc has changed.

    Try for your ScriptReferences the following:

    <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewScript.js" />
    <asp:ScriptReference Assembly="Microsoft.Web.Preview" Name="PreviewDragDrop.js" />

    You might also have to add to your web.config the following in the 'controls' section of your 'pages' node:

    <add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI" assembly="Microsoft.Web.Preview"/>
    <
    add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI.Controls" assembly="Microsoft.Web.Preview"/>

    And, finally, you'll need to make sure that the Microsoft.Web.Preview.dll is in your /bin folder for that website.

    As a final word of caution, the current implementation of FloatingBehavior doesn't play well with controls that are inside parents with relative or absolute positioning (it doesn't calculate the offset right) so you will either need to subclass it to fix it yourself, or else you'll want to be careful to keep your panels inside the default positioning container. 

    Paul

    Help those who have helped you... remember to "Mark as Answered"
Page 1 of 1 (2 items)