PDA

View Full Version : [CLOSED] Ext.net PopUp in CustionFilter using MVC razor Engine



PriceRightHTML5team
Aug 30, 2013, 9:22 AM
Hi,

I am having a Ext.net Popup (Html.X().Window()) on my shared view i.e _Layout.css.
I am using CustomFilter to check whether user is Authorize or not, My requirement is whenever user click on unauthorized page, Popup should appear stating that user is not authorized.

So is there any way to invoke Ext.PopUp from CustomFilter?



//PopUp on _Layout
@(Html.X().Window()
.Width(300)
.ID("NotAuthPopUp")
.Height(300)
.Layout(LayoutType.Fit)
.Icon(Icon.Application)
.Items
(
Html.X().Label("Your are not authorized").Margin(10).StyleSpec("color: red; font-size:30px; font-family:Nyala; background-color: #FFFFCC; display:block; width:auto;")
)
)


//CustomFilter


public override void OnAuthorization(AuthorizationContext filterContext)
{
base.OnAuthorization(filterContext);

if (filterContext.HttpContext.User.Identity.IsAuthent icated && filterContext.Result is HttpUnauthorizedResult)
{
//Invoke Popup from code behind (from CustomFilter)
}
}


Thanks

Daniil
Aug 30, 2013, 2:13 PM
Hi @PriceRightHTML5team,

Please try to make redirection to a controller action where show a popup Window using a PartilaViewResult.