Bug Report T306059
Visible to All Users

HtmlEditor - An uploaded image path is constructed incorrectly when a URL contains different route tokens

created 9 years ago (modified 9 years ago)

I've done a bit of research online, but haven't found an answer to my exact scenario. I have an html editor that is bound to a model property. When attempting to insert an image from my local computer, the upload works normally. However, the thumbnail is a broken image icon both in the select image as well as the html editor. If i look at the html the image src is <img src="…/Content…", If I delete the "…" and change it to <img src="/Content…" the image shows up in the editor. Any ideas/suggestions?

Thanks in Advance.

Comments (3)
DevExpress Support Team 9 years ago

    Hello Sylvan,

    It is difficult to determine the cause of the issue without reviewing the code that you are using. Please provide us with code snippets, which should allow us to reproduce the issue from scratch. Alternatively, send us a sample working project demonstrating the problem in action. We will do our best to determine its cause.

    S S
    Sylvan J Furness 9 years ago

      I have attached a copy of the _HTMLPartial View, Edit View, and Controller that are being used.

      S S
      Sylvan J Furness 9 years ago

        Also, its when I run VS2013 targeting Google Chrome.

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          created 9 years ago

          Hello,

          I have reviewed the provided source code files and suggest that you check the following points:

          1. Make sure that DevExpressEditorsBinder is used instead of the Default Model Binder. See the KA18701: MVC Data Editors - Model Binding and Editing KB Article for more information.
          2. Avoid using nested form tags in the Edit View:

          Current state:

          C#
          @using (Html.BeginForm()) { ... <form> @using (Html.BeginForm()) { @Html.Action("HtmlEditorPartial", Model) } </form> ... }

          Suggested approach:

          C#
          @using (Html.BeginForm()) { ... @Html.Action("HtmlEditorPartial", Model) ... }

          If this does not help, please provide us with a self-contained project (for example, created via the DevExpress Template Gallery -> MVC -> Web Application -> Standard and HtmlEditor inserted via the Insert DevExpress MVC Extension Wizard) that reflects your implementation, actual and expected results (for example, with some screenshots of the F12 -> Dev Tools -> Html Inspector).

            Comments (2)
            S S
            Sylvan J Furness 9 years ago

              I appreciate the response. Thanks for catching my nested form tags, should have caught that. I've narrowed the issue down. The image upload works as expected when the url is http://localhost:1422/Templates/Create, but when it has the id in the URL: http://localhost:1422/Templates/Edit/5, I get a not found exception because the upload images filepath is looking for "~/Template/Content/UploadImages" instead of "~/Content/UploadImages" (Even though the directory is set to "~/Conten/UploadImages". Any ideas/suggestions would be helpful. The project I am having difficulties with is too large to upload (40MB vs. the 30MB Max), but I'll work on getting one uploaded.

              Mike (DevExpress) 9 years ago

                Hello,

                Thank you for your clarification. I have reproduced this issue and forwarded this ticket to our developers for further research.
                We will update this report once any news regarding this subject is available.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.