Base solution for your next web application

Activities of "alukaszewski"

Answer

It's OK, I found answer here:

<a class="postlink" href="https://aspnetzero.com/Documents/Extending-Existing-Entities#add-new-property-to-user">https://aspnetzero.com/Documents/Extend ... ty-to-user</a>

Thanks for the guide!

Question

Hi, is it possible to extend the User Profile/Settings modal? I would like to add another boolean attribute for each user which they can set from the UserSettings modal. What do I need to modify? I have successfully extended global options previously, but I am struggling with adding a simple true/false option for each user. Thanks!

OK, So I think I have the desired result by modifying the web.config to include the following in system.webServer :

<httpErrors errorMode="Custom" existingResponse="Replace">
      <remove statusCode="500" subStatusCode="-1" />
      <error statusCode="500" path="/Error/E500" responseMode="ExecuteURL" />
    </httpErrors>

When a 500 error is encountered, now the page goes to the /Error/E500 page, which is generated by the ErrorController using the _layout.cshtml.

I understand that potentially, if ASP.NET is having issues itself, then the MVC system may not actually return what I need - but hell, the app would be broken so I'm not sure I care so much!

P.S. - That is also for Error 404 - not 500, there may be a difference in handling 500 errors in an MVC application? Maybe with a 500 error we cannot go to a view from a controller and it has to be a static page?

<cite>ismcagdas: </cite> Hi,

You can define a custom page for each error code in your project. You need to set it in web.config like we did for E404 here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/9ec982ce90c2767c7c50d5bc0b834f68c2d43feb/src/MyCompanyName.AbpZeroTemplate.Web/Web.config#L71">https://github.com/aspnetzero/aspnet-ze ... config#L71</a>.

Yes, I have seen and like the Github Error 404 page, however that is NOT within an ASPNETZERO project is it.

If you care to look at my code samples I posted, I do have the web.config configured with a custom redirect for 500 and the necessary E500.cshtml page and modified ErrorController.cs- but the redirect is not occuring - instead the site loads the /Shared/error.cshtml page. If I go directly to "/Error/E500" then I get my custom error page, so I know the controller and page are fine - it is that the site is not redirecting, and instead loading the contents of the /Shared/error.cshtml page - which looks awful.

OK, so I have been reading this blog;

<a class="postlink" href="http://benfoster.io/blog/aspnet-mvc-custom-error-pages">http://benfoster.io/blog/aspnet-mvc-custom-error-pages</a>

and I have discovered that outside of the 404 error handling, ASPNETZERO returns the /Shared/error.cshtml - which doesn't look pretty at all (formatting is all messed up as it doesn't use the layout template.)

I tried looking to see if there was a "HandleErrorAttribute" global filter in my project but I can not find one. How to I get ASPNETZERO to redirect to /Error/E500 when encountering Error 500?

Thanks, Andy.

Question

I'm having trouble getting my application to show my custom page for Error 500.

I have added a new Action Result in the ErrorController.cs as follows:

using System.Web.Mvc;
using Abp.Auditing;

namespace Callisto.Web.Controllers
{
    public class ErrorController : CallistoControllerBase
    {
        [DisableAuditing]
        public ActionResult E404()
        {
            return View();
        }

        public ActionResult E500()
        {
            return View();
        }
    }
}

and created /Views/Error/E500.cshtml with modifications to show different number/text.

If I browse to "/Error/E500" I see my custom E500.cshtml page OK.

To test Error 500 condition, I temporarily rename the website folder Mpa/Views/Dashboard folder to "Dashboardzz" and this generates an ASPNETZERO 500 error page but does not redirect to the /Error/E500 page.

I have web.config CustomErrors configured:

<customErrors mode="On">
      <error statusCode="404" redirect="~/Error/E404" />
      <error statusCode="500" redirect="~/Error/E500" />
    </customErrors>

...but no redirect seems to occur to "/Error/E500"

Am I missing something?

Answer

I am not using multi-tenant. So, how do I show the version in the UI as "DataCenter" instead of "Standard" (in the bottom left corner)?

The _Footer.cshtml contains the code to display in the UI: @(AppVersionHelper._Product_Version) - it's stored in the AbpEditions table as "DisplayName", is there a method to set that value or do I need to update that with my own action?

Question

How do I use Edition Manager to SET a new version, instead of "Standard" ? I am performing a very primitive license key check (domain/date and bitmask feature check) using my own custom action filter attribute each time the user navigates to a new page controller (Mpa project). When the Home controller is ran, I would like my action filter to set the Edition to "Standard" or "DataCenter" based on my own check against the license key.

Could you advise on how I use SET method of the EditionManager to change Edition DisplayName?

Many Thanks!

I found the culprit!

/libs/jquery-jtable/themes/metro/blue/jtable.min.css

contains a list of references to the Open Sans font family hosted by "themes.googleusercontent.com". So I've removed that whole chunk from the CSS and the admin tables still seem to render in Open Sans (probably as I have these in my own fonts.css).

Thanks for your help!

Showing 21 to 30 of 65 entries