Copied to clipboard

Flag this post as spam?

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


  • Dmitriy 168 posts 588 karma points
    May 04, 2018 @ 10:21
    Dmitriy
    0

    How works Html.BeginUmbracoForm() and Url.SurfaceAction()?

    Hello, Umbracians.

    I'am trying to examine how to interract MVC controllers with html forms.

    And there are few misunderstandings about how it works.

    Here is result of Html.BeginUmbracoForm("actionName", "controllerName")

    <form action="/%D0_ManyCharsHere_0%D0%B5/" enctype="multipart/form-data" method="post"> 
        <input name="ufprt" type="hidden" value="083BE_ManyManyCharsHere_AAF">
    </form>
    

    What a atrange value in action atribute? Looks like encrypted name of SurfaceContoller.

    And what is it:

    <input name="ufprt" type="hidden" value="083BE_ManyManyCharsHere_AAF">
    

    Again, looks like some kind of encrypted data that will be send to SurfaceController.

    But, how it interract each other I have no idea. Is it a common ASP MVC mechanism or Umbraco feature?

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    May 05, 2018 @ 08:59
    Marc Goodson
    2

    Hi Dmitriy

    The ufprt value is an 'Umbraco thing'

    To assist with routing of the request for a Html.BeginUmbracoForm and Url.SurfaceAction scenario.

    The ufprt contains an encrypted version of the surface controller route values.

    and if you look here:

    https://github.com/umbraco/Umbraco-CMS/blob/59f9a64e816e40e52a64e1636f743da5effb98b6/src/Umbraco.Web/Mvc/RenderRouteHandler.cs

    The value is decrypted and checked to determine whether the request being made is one to a Surface Controller or not. (SurfaceControllers kind of sit on top of MVCControllers, Umbraco needs to determine whether a request needs to be passed to a SurfaceController - https://our.umbraco.org/Documentation/Reference/Routing/surface-controllers)

    regards

    Marc

  • Dmitriy 168 posts 588 karma points
    May 08, 2018 @ 11:27
    Dmitriy
    0

    The value is decrypted and checked to determine whether the request being made is one to a Surface Controller or not.

    But what for? Tell me more about reason to do it? Are there only one purpose of ufprt - distinguish who request is intended, SurfaceController or common Controller?

    What will happen if I just request SurfaceController without ufprt?

  • pranjal 75 posts 188 karma points
    May 07, 2018 @ 10:04
    pranjal
    0

    I'm not getting your Query please elaborate what you have to do or to find out?

  • Dmitriy 168 posts 588 karma points
    May 08, 2018 @ 11:19
    Dmitriy
    0

    Hi

    I want to know:

    1. What ufprt value for and how that parameter is used next?
    2. What is the utility of SurfaceController name encryprion when form interracts with that controler?
Please Sign in or register to post replies

Write your reply to:

Draft