This question is locked. New answers and comments are not allowed.
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>
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>