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

2 posts, 0 answers
  1. Sandeep
    Sandeep avatar
    1 posts
    Member since:
    Jul 2013

    Posted 02 May Link to this post

    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.
  2. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 05 May Link to this post

    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.
  3. DevCraft banner
Back to Top