RSS

Blog

Monitor Page Load Times

You can monitor the network tab in your browser devtools for slow scripts/images, or something like this will give you more information than you could ask for: https://developers.google.com/speed/pagespeed/insights/

Formating PDF Printouts

You can create nested tables

See https://www.c-sharpcorner.com/UploadFile/f2e803/basic-pdf-creation-using-itextsharp-part-i/

You can add a page number in a footer

// In the main program

            var doc = new Document(pageSize);
            var pdfWriter = PdfWriter.GetInstance(doc, stream);
            doc.Open();
            
            pdfWriter.PageEvent = new PageHeaderFooter();

// In the PDF Class

        public class PageHeaderFooter : PdfPageEventHelper
        {
            private readonly Font _pageNumberFont = new Font(Font.HELVETICA, 8f, Font.NORMAL);

            public override void OnEndPage(PdfWriter writer, Document document)
            {
                AddPageNumber(writer, document);
            }

            private void AddPageNumber(PdfWriter writer, Document document)
            {

                var text = writer.PageNumber.ToString();

                var numberTable = new PdfPTable(2) { WidthPercentage = 100f };
                numberTable.SetTotalWidth(new float[] { 250, 250 });

                var textCell = new PdfPCell(new Phrase("Report Name", _pageNumberFont)) 
                    { HorizontalAlignment = Element.ALIGN_LEFT, Border = Rectangle.TOP_BORDER, BorderWidthTop = 0.5f };               

                var numberCell = new PdfPCell(new Phrase(text, _pageNumberFont))  
                    { HorizontalAlignment = Element.ALIGN_RIGHT, Border = Rectangle.TOP_BORDER, BorderWidthTop = 0.5f };

                numberTable.AddCell(textCell);

                numberTable.AddCell(numberCell);

                numberTable.WriteSelectedRows(0, -1, document.LeftMargin, document.Bottom + 20, writer.DirectContent);
            }
        }

Publishing and Running ASP.NET Core Applications with IIS
Here is an interesting article regards building ASP.NET Core applications when planing to run them on IIS, you'll find that .NET Core applications in IIS work radically different than previous versions of ASP.NET.
CKEditor Settings

For CKEditor Plugin 

There is a configuration file nopCommerce/Plugins/Editor.CKEditor/Scripts/CKEditor/config.js

You can edit this file and add configs

E.g. config.height = 800;

The settings can be found here https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html

A few tips for using Rich Text Editor and Adding Images in HTML Content Blocks
This Blog is about the settings and things that allow the adding of images to the Blog and other HTML Content areas
Facebook login not working ?
The Facebook Authorisation plugin allows you to login using Facebook but sometimes there can be problems with configuration, here are a few pointers.
Checking for Errors on a New Installation of NopCommerce

Check Error Logs

1. In Web.config change stdoutLogEnabled = "false" to true, Restart Application

then check the logs at \wwwroot\nopCommerce\Logs

The error(s) there might tell you something.

2. Check your Application and IIS Application logs in the Event Viewer.

The error(s) there might tell you something.

See Event Viewer Application Logs

nopCommerce difference between Non-Source and Source Version

The version that runs on the webserver is in fact the non-source version
So the non-source version is created from the source version. That is, the output of building the source version with Visual Studio is to create the non-source version.

So when it comes time and you want to change the core program you can download and use the current version of the source code version make changes then build a new non-source version

Although for developers the preferred way is not to change the core of the source version but in fact to make plugins that change, overwrite or override the functionality of the core code. In that way the system is easier to build upon, upgrade and maintain because when a new version comes along it is just a matter of updating your plugin to work with the new version.

Installing nopCommerce - Tips and Tricks

Set Privileges on the Directory Folder

If you are creating a database you need create database privs on the SQL Server
In my case that means website application i.e. "IIS AppPool\<myappoolname>"
Needs create database privs on the master database

How a blog can help your growing e-Commerce business
When you start an online business, your main aim is to sell the products, right? As a business owner, you want to showcase your store to more audience. So, you decide to go on social media, why? Because everyone is doing it, then why shouldn’t you? It is tempting as everyone is aware of the hype that it is the best way to market your brand. Do you know having a blog for your online store can be very helpful? Many businesses do not understand the importance of having a blog because they don’t have time to post quality content. Today, we will talk about how a blog can play an important role for the growth of your e-Commerce business. Later, we will also discuss some tips that will be helpful to you for writing business related blog posts.