Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "exlnt"

I am running into some errors/issues with my implementation of Google maps APIs in my app. Specifically with modals. On index pages, the google maps functions all work just fine. But once I move it into a modal, I run into issues.

My questions on scripts used for modals are as follows:

Q1. What is the best place to use/insert a JS script or JS code that needs to execute before the user sees the modal? Q2. Where should JS event functions, like the one shown below, be placed? These need to fire after the modal is open and the user takes action on a select1.

$("#Select1").change(function () {
    Fill_Select2();
    });

I typically place these types of functions/events directly in the modal.cshtml file at the very end, after all the HTML. These events dont always work when I place them in the createModal.js script files.

Q3. For google maps I need to place the below script entry, before I add my JS code, to make the maps work. I have added these into my modal.cshtml.

<script src="https://maps.googleapis.com/maps/api/js?key=XX" async defer></script>

However this leads to warnings/errors that I have loaded google maps API too many times. This happens as the user will enter/exit the modal multiple times from my index pages. So where would be the best place to add this script?

These questions are just to seek guidance on best practice for the items below. I have the read the docs and still a bit confused as to the best location for such things.

In multiple app services I have code that is repeated for a "shared" entity. Naturally trying to follow the DRY principle I would like to consolidate this code to a single location.

  • Questions
    • Can I move such code into the base application service class (MyAppAppServiceBase)?
    • The code that is repeated is using a repository for an entity and making inserts into a table. So naturally I'm injecting the repository into the app service through the constructor, can I do this in the base class?

In multiple MVC controllers I have code that is repeated for a "shared" entity. Naturally trying to follow the DRY principle I would like to consolidate this code to a single location.

  • Question
    • Can I move such code into the base MVC controller class (MyAppControllerBase)?

I have implemented SendGrid for emails into my AZN V6.3 solution. I am storing my SendGrid API key value in the SMTP settings. In the host settings app service when the password value is saved, it uses the encrypt code shown below. await SettingManager.ChangeSettingForApplicationAsync(EmailSettingNames.Smtp.Password, SimpleStringCipher.Instance.Encrypt(settings.SmtpPassword))

So naturally when I try to retrieve this password for my SendGrid send email method, I use decrypt code, shown below. var apikey = await _settingManager.GetSettingValueForApplicationAsync(SimpleStringCipher.Instance.Decrypt(EmailSettingNames.Smtp.Password));

However when this code executes, it throws this error: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

The SendGrid API key does contain a . and _ is 69 characters long.

I did find some solutions on stackoverflow. However I cannot apply the "replace" option here, as the password is generated and provided by SendGrid.

Do I have any other options to be able to decrypt this type of password with AZN code? For now, I have just hard-coded the API key.

I just published my AspNetZero V6.3 application to my domain. For the most part everything is working well.

All of my "create" modals along with the AspNetZero "create" modals are working. The issue are coming up on every single "actions" button on every single index view. I am unable to "edit" anything in the entire application. The language dropdown also throws errors.

I am also unable to get the UI customization changes to work fully. That also is throwing some error and not rendering the UI properly.

There are just so many errors being reported in the chrome console. Shown below are just a few.

Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'javascript:;' is not a valid selector.
    at Object.getSelectorFromElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:1912)
    at Function.n._getParentFromElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:25437)
    at Function.n._clearMenus (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:24832)
    at n.f.toggle (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:21299)
    at HTMLButtonElement.<anonymous> (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:23280)
    at HTMLButtonElement.dispatch (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:50792)
    at HTMLButtonElement.a.handle (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:48811)
app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'javascript:;' is not a valid selector.
    at Object.getSelectorFromElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:1912)
    at Function.n._getParentFromElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:25437)
    at n.f._getMenuElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:23492)
    at new n (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:21015)
    at HTMLAnchorElement.<anonymous> (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:24504)
    at Function.each (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:15094)
    at i.fn.init.each (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:13755)
    at i.fn.init.n._jQueryInterface [as dropdown] (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:24428)
    at HTMLAnchorElement.<anonymous> (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:26632)
    at HTMLDocument.dispatch (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:50792)
Roles:1 Refused to apply style from 'http://tenant1.mysite.com/Error?statusCode=404' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
DevTools failed to parse SourceMap: http://tenant1.mysite.com/lib/@aspnet/signalr/dist/browser/signalr.min.js/signalr.min.js.map

Can you please let me know what I should check and/or what could be the source of the error? I dont get any of these errors on my desktop in my development environment.

I am using the JS code shown below on a couple of my forms.

var HomeDates = function () {

    // set default dates
    var start = new Date();
    // set end date to max 99 year period:
    var end = new Date(new Date().setYear(start.getFullYear() + 99));

    $('#CloseDate').datetimepicker({
        locale: abp.localization.currentLanguage.name,
        format: 'L',
        useCurrent: false,
        minDate: $("#InServiceDate").val(),
        maxDate: end
    });

    $('#InServiceDate').datetimepicker({
        locale: abp.localization.currentLanguage.name,
        format: 'L',
        maxDate: end
    }).on("dp.change", function (e) {
        //Get new date value from the field on change
        var closeDateMin = new Date(e.date);
        $('#CloseDate').data("DateTimePicker").minDate(closeDateMin);
    });

}

When the application language is set to english things work just fine. However, once the user changes the language to MX or ES or any other language where the date format changes from MDY to DMY it throws JS errors in chrome console. The field "InServiceDate" is set to todays date from my Asp.Net MVC controller method (Not localized) when it sends the model to the page. But when the language is, for example, MX it changes the date shown in the text box from MM/DD/YYYY to DD/MM/YYYY HH:MM:SS. This breaks my JS code for "CloseDate". It gives the error TypeError: minDate() Could not parse date parameter: 20/12/2018 12:02:54.

As per the snippet from the moment.js docs, shown above, using the "L" format should render my date correctly in all locales and this works perfectly in all my grid/index views where dates are displayed. They get set in the local format properly no matter what language is chosen.

Am I missing something and/or what am I doing wrong?

Question

I am working on the AspNetZero .NET Core MVC JQuery, version 6.3.1. I am copying over the code from my existing AspNetZero solution into the new version one entity at a time. I realize this issue may not necessarily be an AspNetZero issue. However the code I'm using in this issue works perfectly in my Non-AspNetZero solution and is not working here in the AspNetZero solution. I have an entity named "LegalEntity" in my application. I have one property in my EditDto for this entity that does not exist in the entity or table, name "NewNote". When I run my app and goto the edit view for "LegalEntity" which uses the EditDto in its viewmodel, i get this AutoMapper error. I then applied this codeconfiguration.CreateMap<EditLegalEntityDto, LegalEntity>().ForSourceMember(dto => dto.NewNote, opt => opt.Ignore()); into the CustomDtoMapper class. Now when I run the application I get this auto-mapper error. I can see similar ignore mappings in the CustomDtoMapper class that were added by the AspNetZero team. I am following the same coding.

Can someone tell me what I am missing or doing wrong here? Thanks! Exlnt

I have read this ABP Document and this Forum post. I have checked my page and both scripts (blockUI  and spin.js) are loaded on the page. When I use this line of code:  abp.ui.setBusy('.login-form'); It does not show the blockUI overlay at all. When I use this line of code: abp.ui.block(); it does block the whole page. However it does NOT show any kind of "Spinner". How do I use blockUI and get it to display a spinner. Also, how do I choose the type of spinner displayed. I would very much like to use the spinner you are using on your demo portal on the AspNetZero site.

I just downloaded my new licensed code from my download page. I have followed ALL of the steps on this guide: Getting-Started-Core. I ran the migrator project first to get the database created. The DB is now present. Then when I launched the MVC web project and once I get to the login page, nothing works! When I look at Chrome console, I see the errors show in the attached image ASPNETZERO_Startup_JS_Errors.JPG

I just checked into this further and script file src="/view-resources/Areas/CareOps/Views/_Bundles/account-layout-libs.js" is empty. How does this file get created or am I missing something?

We purchased a license to ASPNETZERO almost 9 months or so ago. During that time we have learned a lot and come to appreciate the benefits of using the template. The support provided has also been very helpful.

However a couple of areas that are severely lacking is your documentation and communication. I realize that English is second language for most of the ASPNETZERO team and thus the issues with documentation. I think you are doing your team and your product a disservice by not using someone who knows English as a first language to write your documents. I think it would be huge benefit to your team and your product to hire or use a professional technical writer, who knows English, to write your documents. The second area that is lacking is how you communicate the release updates and the related change logs. You need to setup a page along with your documentation that clearly details all the changes included and the breaking changes.

I dont think I am alone in voicing these concerns. Based on many of the postings I have read on this forum over the last 9 months, this is a recurring theme from your customers.

I am <span style="color:#FF0000">not </span>posting this as a criticism for the ASPNETZERO team. I am sincerely trying to give constructive feedback so that it may help you to enhance your product. In my opinion you have built something really good here and you are hurting yourself and your product with the aforementioned issues.

Respectfully, Exlnt!

I just deployed my V4.X application to my hosting provider for the first time after I completed the upgrade to V4.X. When I attempt to create a new tenant, I get the below error related to MSDTC.

System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool. ---> System.Runtime.InteropServices.COMException: The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)
   at System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim)
   at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
   --- End of inner exception stack trace ---
   at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)
   at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)
   at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx)
   at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx)
   at System.Transactions.EnlistableStates.Promote(InternalTransaction tx)
   at System.Transactions.Transaction.Promote()
   at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)
   at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
   at System.Data.SqlClient.SqlInternalConnection.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts)
   at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
   at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
   at System.Data.SqlClient.SqlInte...

This is the exact same error I reported early this year: [https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=4906]) I tried to apply the same code fix (below) to my V4.X solution but it will not compile.

//20170130 - Added for disabling MSDTC transactions 
 Configuration.ReplaceService<IEfTransactionStrategy, DbContextEfTransactionStrategy>(DependencyLifeStyle.Transient);

In V4.X, Is there another way to disable MSDTC?

Showing 11 to 20 of 53 entries