[CLOSED] Running an application with a relative address

  1. #1

    [CLOSED] Running an application with a relative address

    I would like to know how to config an application to run with a relative address.

    Click image for larger version. 

Name:	path001.png 
Views:	19 
Size:	35.0 KB 
ID:	6064

    On the following example, the click fails when the application is running under a relative address.

    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
    <script type="text/javascript">
        var click = function () {
    
            Ext.net.DirectMethod.request({
                url: "Example/PersistirRegistro",
                cleanRequest: true,
                success: function (result) {
                    alert('Sucess');
                },
                failure: function () {
                    alert('Failure');
                }
            });
        }
    </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Button Text="click me" runat="server">
            <Listeners>
                <Click Handler="click();" />
            </Listeners>
        </ext:Button>
    </body>
    </html>
    public class ExampleController : System.Web.Mvc.Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    
        public AjaxResult PersistirRegistro()
        {
            return new AjaxResult();
        }
    }
    Any ideas to overcome this issue?
    Last edited by Baidaly; Apr 18, 2013 at 9:43 PM. Reason: [CLOSED]
  2. #2
    You can use <%= %> blocks
    url: '<%= Url.Action("Example/PersistirRegistro") %>',
    or try this
    url: Ext.net.ResourceMgr.resolveUrl("~/Example/PersistirRegistro"),
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    Thank you Vladmir. it worked like a charm.

    Please mark this thread as closed.

Similar Threads

  1. Binding Address Type Combo with Address Details
    By alexvazquez in forum 1.x Help
    Replies: 0
    Last Post: Sep 23, 2011, 3:30 PM
  2. Replies: 5
    Last Post: Jul 25, 2011, 6:14 PM
  3. [CLOSED] Window position relative
    By 78fede78 in forum 1.x Premium Help
    Replies: 4
    Last Post: Nov 24, 2010, 4:46 PM
  4. Absolute/relative routes in MVC
    By Dominik in forum 1.x Help
    Replies: 2
    Last Post: Jun 21, 2010, 3:15 PM
  5. Error when running a published application
    By Jurke in forum 1.x Premium Help
    Replies: 6
    Last Post: Nov 18, 2008, 3:22 AM

Posting Permissions