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

[Solved] Custom Authorization Telerik Controls

0 Answers 19 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Partha
Top achievements
Rank 1
Partha asked on 17 Oct 2012, 06:32 AM
I am trying to restrict the users to access the telerik Menu Items using the Custom Authorization. My custom Authorization works but the problem is with displaying the message. In the telerik menu How do i display the message in telerik modal window.

My controller :--

 public ActionResult _notAuthorized()
        {
            
            ViewBag.Message = "You are not authorized to view this section. Please Contact Adminstrator for the rights";
            return PartialView("_NotAuthorized");
        }

My partial view :--

<script type="text/javascript">
    $(document).ready(function () {
        $(".t-window-title", $("#ModalWindows")).html("Not Authorized");
        $(".t-content", $("#ModalWindows")).css('height', '150px');
        $(".t-content", $("#ModalWindows")).css('width', '300px');
      
    });
</script>
<p style="color:Red">@ViewBag.Message</p>    

My Modal window:-- 

 @{ Html.Telerik().Window()
        .Name("ModalWindows")
        .Title("None")
        .Draggable(true)
        .Visible(false)
        .Modal(true)
        .Buttons(b => b.Close())
        .Height(250)
        .Width(1000)              
        .Content(
        @<text>
        <div id="ModalWindowsContent">
        
        </div>
        </text>)
        .Render();
    }
    <script type="text/javascript">
        function ModalWindows(onAction) {
            if (onAction == 'OnComplete') {
               $('#ModalWindows').data('tWindow').refresh();
               $('#ModalWindows').data('tWindow').center().open();
            }
       };


       $(document).ready(function () {
           var browserWidth = $(window).width();
           var browserHeight = $(window).height();
       });


    </script>    


Tags
Menu
Asked by
Partha
Top achievements
Rank 1
Share this question
or