This is a migrated thread and some comments may be shown as answers.

Please help to call different Angular JS Screen from silverlight application using telerik RadhtmlPlaceHolder

1 Answer 38 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Sandeep
Top achievements
Rank 1
Sandeep asked on 02 May 2016, 12:56 PM
Hello,

I am trying to open below URL with query string  from silverlight XAML page

Silverlight Project :

I have used telerik RadhtmlPlaceHolder as below :

 xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"    
>
    <UI:GroupBox>
        <Grid>
            <telerik:RadHtmlPlaceholder x:Name="RadHtmlPlaceholder1" Grid.Row="0" x:FieldModifier="public" />           
        </Grid>
    </UI:GroupBox>

And load URL from code behind we screen is opened  as below :

private void OpenNSScreens()
        {
            try
            {
                this.Dispatcher.BeginInvoke(delegate
                {
                    this.RadHtmlPlaceholder1.SourceUrl = new Uri("https://10.100.112.23:8074/login?oIFt7TZ0aPMkx589qvLVo7BnXsvYkHxwbJHYIP/1GJeSvTDwSOVPl4EWKG1frk7f");
                   
                });
            }
            catch
            {
                throw;
            }
        }


ASPX project : (Angular JS)

I have added one controller and in controller i have method named "" from where above encrypted string is decrypted :

 public class LoginUserController : ApiController

{

     public static string Decrypt(string input, string password)
    {

        // Logic

    }

}

What actually happened is some sometimes my Decrypt method is not posted from .js file at that time my functionality is not working

Js is as below :

app.controller("LoginUserController",
    function LoginUserControllerFunc($scope, $http, ngEncryption, $cookies, $location, $rootScope) {

  var querystring = window.location.search.substring(1);
        if (querystring != null && querystring != undefined && querystring.length > 0) {
            var request = $http({
                method: "POST",
                url: "/api/LoginUser/DecryptString",
                params: { encryptionText: querystring }
            }).then((function myfunction(successdata) {
                if (successdata.status == "202") {
                    $scope.LoginUser.ErrorMsg = successdata.data;
                }
                else {
                    querystring = successdata.data;
                }               
                $scope.IsFromSilverlight = true;                                     
                var obj = JSON.parse(successdata.data);
                $scope.UserList = obj;
                if (obj != null) {
                    window.location.href = "/WelcomeScreen";
                }

            }));
        }

});

Please let me know what can I do to resolve this issue.

1 Answer, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 05 May 2016, 12:08 PM
Hello Sandeep,

You have mentioned that sometimes the Decrypt method is not posted from .js, which means that it sometimes does, is that right? If that is the case I guess there is some kind of timing issue between the loading of the page and its resource. I am afraid that without a sample project reproducing this complex case we could not guess from where the issue is coming.

Kind regards,
Kiril Vandov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
HTMLPlaceHolder
Asked by
Sandeep
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Share this question
or