Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Erik Ian Cheatham 1 post 21 karma points
    Jul 23, 2014 @ 16:24
    Erik Ian Cheatham
    0

    Ajaxcontroltoolkit -V 7.1213.0 on Umbraco v6.1.6 Backoffice Content Pages Render No AJAX Functionality

    I added the Ajaxcontroltoolkit.dll and min.dll to the Umbraco bin.  Built my web control with a ajaxfileupload because it needs to connect to the Amazon S3 storage service with Elastic Transcoder operations.  I quickly found that adding my toolkit script manager within the user control would not work.  I need this control in the back office to be used on a content page by permissioned users/members.  So When I copy the .dll to the bin and the usercontrol to the usercontrol folder.  I create the datatype, add it to a new root level document type (testing homepage).  I cannot get any ajax functionality to render on any back offive pages.  I've put my ajaxtoolkitscript manager as a separate datatype, added it to document type on the page above the user control, I've created it as a macro and placed in the content page, and I've added the macro into the template which was copied from the starter kit web forms template.

    I'll just work on picking the media nodes out from the Umbraco media class to build a URL for my later uploaded items. Please help!  Code below:

    Web Control:

     

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="myComp.SCO.Management.ascx.cs" Inherits="myComp.SCO.Management.myComp_SCO_Management" %>

    <%--<ajaxToolkit:ToolkitScriptManager runat="server"></ajaxToolkit:ToolkitScriptManager>--%>

    <asp:HyperLink ID="HyperLink1" runat="server">HyperLink</asp:HyperLink>

    <br />

    <br />

    <ajaxToolkit:AjaxFileUpload

        ID="AjaxFileUpload1"

        AllowedFileTypes="zip"

        MaximumNumberOfFiles="5"

        OnUploadComplete="AjaxFileUpload1_OnUploadComplete"

        runat="server" />

    <br />

    <br />

    <div style="width: 300px;">

        <asp:Label ID="Label0" runat="server" Text="Label0"></asp:Label>

        <br />

        <asp:TextBox ID="TextBox0" Width="300px" runat="server" Text="TextBox0" TextMode="MultiLine" Rows="2"></asp:TextBox>

    </div>

    <br />

    <br />

    <div style="width: 300px;">

        <asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label>

        <asp:TextBox ID="TextBox1" Width="600px" runat="server" Text="TextBox1" TextMode="MultiLine" Rows="2"></asp:TextBox>

    </div>

    <br />

    <br />

    <div style="width: 300px;">

        <asp:Label ID="Label2" runat="server" Text="Label2"></asp:Label>

    </div>

    <br />

    <br />

    <div style="width: 300px;">

        <asp:Label ID="Label3" runat="server" Text="Label3"></asp:Label>

    </div>

    <br />

    <br />

    <div style="width: 300px;">

        <asp:TextBox ID="TextBox3" Width="300px" runat="server" Text="TextBox3" TextMode="MultiLine" Rows="2"></asp:TextBox>

    </div>

    .cs
    public partial class LeadingRE_SCO_Management : System.Web.UI.UserControl,
            umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor
        {
            [DataEditorSetting("S3 URL",
                type = typeof(umbraco.editorControls.SettingControls.TextField),
                defaultValue = "derp")]
            public string S3URL { get; set; }
            [DataEditorSetting("Upload SCO",
                type = typeof(umbraco.editorControls.SettingControls.TextField),
                defaultValue = "derp")]
            public string UploadSCO { get; set; }
            [DataEditorSetting("Link To Document",
                type = typeof(umbraco.editorControls.SettingControls.TextField),
                defaultValue = "derp")]
            public string LinkToDocument { get; set; }
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!Page.IsPostBack && Request.Url.OriginalString.Contains("macro"))
                //if (Page.IsPostBack)
                {
                    //New Tests
                    Media m = new Media(Node.GetCurrent().Parent.Id);
                    //Media m2 = new Media();
                    string val = m.getProperty("propertyAlias").Value.ToString();
                    string boohoo = m.Path;
                    //Loading Test values
                    _umbval = string.Format("{0}|{1}|{2}|{3}|{4}", val, boohoo, S3URL, UploadSCO, LinkToDocument);
                    LoadValues();
                }
                else
                {
                    //Media m = new Media(Node.GetCurrent().Parent.Id);
                    //string val = m.getProperty("propertyAlias").Value.ToString();
                    //string boohoo = m.Path;
                    //Label0.Text = m.getProperty("propertyAlias").Value.ToString(); ;
                    //Label1.Text = m.Path;
                    //Label2.Text = val;
                    //Label3.Text = boohoo;
                    if (Label0.Text == "")
                    {
                        Label0.Visible = false;
                        TextBox0.Visible = false;
                    }
                    else if (Label1.Text == "")
                    {
                        Label1.Visible = false;
                        TextBox1.Visible = false;
                    }
                    else if (Label2.Text == "")
                    {
                        Label2.Visible = false;
                    }
                    else if (Label3.Text == "")
                    {
                        Label3.Visible = false;
                        TextBox3.Visible = false;
                    }
                }
            }
            private string _umbval;
            public object value
            {
                get { return _umbval; }
                set { _umbval = value.ToString(); }
            }
            private void LoadValues()
            {
                string[] values = _umbval.Split('|');
                for (int i = 0; i <= values.Length; i++)
                {
                    if (values[i] == "")
                    {
                        if (i == 0)
                        {
                            Label0.Visible = false;
                            TextBox0.Visible = false;
                        }
                        else if (i == 1)
                        {
                            Label1.Visible = false;
                            TextBox1.Visible = false;
                        }
                        else if (i == 2)
                        {
                            Label2.Visible = false;
                        }
                        else if (i == 3)
                        {
                            Label3.Visible = false;
                            TextBox3.Visible = false;
                        }
                        continue;
                    }
                    else
                    {
                        Label txtPath = (Label)FindControl("Label" + i);
                        if (txtPath != null)
                            txtPath.Text = values[i];
                    }
                }
            }
            protected void AjaxFileUpload1_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
            { return; }
    Web.config
    <?xml version="1.0"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      -->
    <configuration>
      <system.web>
        <compilation debug="true" targetFramework="4.5">
          <assemblies>
            <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
          </assemblies>
        </compilation>
        <httpRuntime targetFramework="4.5" maxRequestLength="42949672" />
        <!--<httpHandlers>-->
          <!--<add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
        </httpHandlers>-->
        <pages>
          <controls>
            <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
          </controls>
        </pages>
      </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <!--<handlers>
          <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
        </handlers>-->
        <security>
          <requestFiltering>
            <requestLimits maxAllowedContentLength="4294967295"/>
          </requestFiltering>
        </security>
      </system.webServer>
    </configuration>
Please Sign in or register to post replies

Write your reply to:

Draft