View Full Version : [CLOSED] Tying a Ext.NET Mobile application to an Ext.NET application

Dec 13, 2016, 6:39 AM
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

Dec 13, 2016, 1:38 PM
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? (http://stackoverflow.com/questions/1214607)

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.

Jan 03, 2017, 9:37 PM
Hello @Zdenek!

Been some time since we replied your inquire and no feedback so far. Do you still need help with this?

Jan 04, 2017, 7:11 AM

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().getLoginTicke t();
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


Jan 05, 2017, 5:15 PM
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 (http://forums.ext.net/forumdisplay.php?12-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!