[CLOSED] Tying a Ext.NET Mobile application to an Ext.NET application

  1. #1

    [CLOSED] Tying a Ext.NET Mobile application to an Ext.NET application

    probably there is easier soution to that
    So I have one big application written in last years using Ext.net and now I'm starting to write small application usine Ext.Mobile. I would like to have direct calls from mobile application to be called on the bigger one (so technically I want to change url of direct methods. After some fights with CORS it seems to work using simple trick:

    	function beforeAjaxRequest(con, options, eOpts, params,request) {
    		request.url = http://kilkelly/bigapplication/WindowsApp/ALAMobile.aspx";
    		request.headers['X-Ext-Net'] = request.headers['X-Ext-Net-Mobile'];
    it works fine if I run mobile application using


    Hovewer it doe not work when I load mobile application using different cookie domain like


    Direct methods are called hovewer the authentication cookies are not passed

    Note that at the end I would like to have following 3 applications
    a) separate mobile application
    b) mobile and web application on IIS application( this one works fine now)
    c) mobile hybryd" application, packed using cordoba or xamarin accessed from localhost/mobileapplication directly on device and connecting to bigapplication on IIS

    c) is bit out of scope of this discussion, if I'm sucesfull I will write details to another thread soon
  2. #2
    Hello @Zdenek!

    Can't you bind the domain in the script to a ASP.NET variable? like:

    request.url = "<%= HttpContext.Current.Request.Url %>bigapplication/WindowsApp/ALAMobile.aspx";
    Or further dig it and build with

        context.Request.Url.Port == 80
        ? string.Empty
        : ":" + context.Request.Url.Port);
    [i]Source: Stack Overflow - How can I get the root domain URI in ASP.NET?

    Or maybe you are changing this when you move from domains and it still don't work? Could be a browser limitation regarding XSS or something like it.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello @Zdenek!

    Been some time since we replied your inquire and no feedback so far. Do you still need help with this?
    Fabrício Murta
    Developer & Support Expert
  4. #4

    I'm taking Zdenek's tasks. Finally after fighting with cookies I decided to try with extra parameters of (all) direct methods

    protected void Application_AuthenticateRequest(Object sender, EventArgs e)
    ...		{
    var mobileLoginTicket = Request["mobileLoginTicket"];
     // here validate ticket and set user if ticket is valid, tickets are stored in db
    and on client

    function beforeAjaxRequest(con, options, eOpts, params, request) {
    		params.mobileLoginTicket = ALAMobile.Win.Application.instance().getLoginTicket();
    		request.url = fixedServerUrl()+"/WindowsApp/ALAMobile.aspx"; // fixedServerUrl() returns  predefined url to the server
    		request.headers['X-Ext-Net'] = request.headers['X-Ext-Net-Mobile'];

    Working for us and is part of the overall mobile solution where result of ext.net mobile is apk file for android

    The only problem I'm aware of is that expiration of ticket needs to be managed by us

    Not sure if you are interested in details, I'm fine with dsending you complete sample in some way but it's probably above scope of this thread

  5. #5
    Hello Jiri, and welcome to Ext.NET forums!

    Well, if your solution (or the relevant parts) can be represented in simpler code tags as you posted above, that would be great. I was not seeing much of a possibility of using cookies unless a single sign on (SSO) approach were implemented, which is beyond the scope of Ext.NET anyway (Ext.NET is not responsible for making it possible or impossible, so we can't really help much with that topic).

    If you are willing to post a full example or tutorial, we have the forums section Examples and Extras which we and the community use to share interesting usage examples of Ext.NET.

    Thanks for your feedback, and glad you could find a solution that works for you in that matter!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Ext.net Desktop and Mobile application
    By bobzz in forum 3.x Help
    Replies: 1
    Last Post: Aug 21, 2015, 2:59 PM
  2. Replies: 0
    Last Post: Apr 27, 2015, 11:23 AM
  3. Sample Application on MVC 4 with Ext.Net
    By sundarsureshin in forum 2.x Help
    Replies: 3
    Last Post: Jul 01, 2014, 2:31 PM
  4. RIA application using asp.net
    By sahuvijay in forum 2.x Help
    Replies: 1
    Last Post: Mar 19, 2013, 1:38 AM
  5. ASP.NET MVC 3 web application
    By fosteliss in forum 2.x Help
    Replies: 0
    Last Post: Jul 25, 2012, 4:32 PM

Posting Permissions