Link to home
Start Free TrialLog in
Avatar of futuremoose
futuremoose

asked on

XBAP hosted in HTML can read string from HTML TextBox?

I have a ASP.Net project, and I have added an iFrame to host an XBAP. Since several users may be hitting the application at the same time, the HTML carries with it a unique instance ID... it is usually just a unique number in a Label.

I would like the XBAP to have access to this ID because it will itself be making calls back to the server for some loose XAML, and it will need to reference the correct session folder for it's data (e.g. loose XAML graphics, unique to the user's session). Ideally, I would like the XBAP to just pull the Label.Caption from the HTML on the Client machine, and use it to construct the SiteOfOrigin reference string when it pulls down the loose XAML.

If that is not possible, is there some other way I can pass down the unique session ID string along with the XBAP stuff? (It needs to be XBAP and not loose XAML, since I need code-behind).

Someone mentioned the possibility of the HTML setting a cookie on the Client IE, and then having the XBAP reference that... can an XBAP reference IE cookies?
ASKER CERTIFIED SOLUTION
Avatar of nayangp
nayangp
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Vaughn Bigham
For example, here is a module that I am using to send a message back to an asp.net page where closeMe() is the name of the javascript method that determines a message to send to the hosting browser container, then closes the xbap
Imports System.Windows.Interop

Module MyInteropHelper

    Public Function Close() As Boolean
        Try : BrowserInteropHelper.HostScript.closeMe() : Return True : Catch : Return False : End Try
    End Function 

End Module

Open in new window