Meet The Author

I'm Ethan Jackson, An 25 years old blogger Currently living in London, United Kingdom. I'm a Skilled Blogger, Part Time web Developer And Creating new things as a web Designer.

author

Best & Cheap Drupal 11.0.4 Hosting in Australia

Leave a Comment
If you're looking for Best, Cheap Drupal 11.0.4 Hosting in Australia, we'll offer you with the answer. Extremely Drupal 11.0.4 is user-friendly - setup requires no programming knowledge and the interface is modern and intuitive. Drupal 11.0.4 offers a one-page checkout process. Drupal 11.0.4 is built-in coupons, sales pricing, up-selling, and cross-selling functionality.


 
Drupal 11.0.4 is a free and open source content management system (CMS). DiscountHosting.com.au is a leading provider of web hosting, now hosting many domain names. Tens of Thousands of Drupal clients depend on DiscountService's reliable hosting environment to keep their Drupal-powered web sites running smoothly.

Best Drupal 11.0.4 Hosting in Australia with Special Price

DiscountService.biz is a line of business under Macrodata Enterprise (ABN: 42 797 697 621), specializes in providing web hosting service to customers in Australia. DiscountService.biz is an excellent Drupal 11.0.4 hosting provider focusing on providing rich-featured and super fast web hosting solutions to all kinds of customers ranging from personal bloggers to enterprises. Now webmasters wonder whether this company is good for Drupal 11.0.4 websites, so our editors conduct a comprehensive review on the company in price, features, usability, uptime, speed and technical support.

http://www.discountservice.biz/Australia-Visual-Studio-2017-Hosting

DiscountService.biz offers a variety of cheap and affordable Australia Windows ASP.NET Shared Hosting Plans to fit any need. No matter whether you’re starting a Blog with WordPress, installing a CMS solution with Drupal, opening a Forum with PHPBB, starting an Online Store with Drupal 11.0.4, or any number ventures beyond those mentioned above, our Windows ASP.NET Web Hosting plans are exactly what you’ve been looking for.

Microsoft presents this award to DiscountService.biz for the ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2012, ASP.NET 5 / ASP.NET Core, ASP.NET MVC 6.0/5.2, Silverlight 5 and Visual Studio Lightswitch. 

DiscountService.biz Drupal 11.0.4 Hosting Review on Feature, Price and Performance

Available at this low price, the Beginner plan comes with sufficient web hosting resources and the latest versions of almost all the widely-used software, such as unlimited 2 GB Disk Space storage, 20GB monthly data transfer, unlimited hosted domains, PHP 5.5, MySQL 5.5, SQL 2008/2012/2014, etc. As a leading small to mid-sized business web hosting provider, they strive to offer the most technologically advanced hosting solutions available to their customers across the world. Security, reliability, and performance are at the core of their hosting operations to ensure each site and/or application hosted on their servers is highly secured and performs at optimum level. Unlike other web hosting companies, they do not overload their servers.
https://discountservice.biz/

All DiscountService.biz servers are equipped with minimum Intel Dual Processor Multi Core, 8 GM RAM and the fastest 1,000 Mbps connection backbone. This is to ensure that all sites hosted on our server has an access to the best performance, reliability and connectivity feature.

DiscountService.biz data center is located at Sydney, NSW. Their data centers are built upon a unique pod design concept, making them functionally independent with distinct and redundant resources, and fully integrated through their revolutionary network architecture. You can have direct control over your system in any data center and full access to all of their back-end services—all fully automated and on demand.

With their fully support on Microsoft Windows and ASP.NET, DiscountService.biz is the best choice to host your Drupal. The following are some of the reasons why you should choose them as your Drupal Hosting provider:
  1. Load balanced They automatically distribute traffic across multiple servers to help prevent sudden, unexpected surges from affecting workload performance.
  2. Monitored 24x7x365 Continuous monitoring enables them to proactively respond to anomalies—like suspicious traffic or attempted spam attacks.
  3. High performance They use high quality hardware and server. Their infrastructure is amongst the fastest in the World. UK data center. 

DiscountService.biz Drupal 11.0.4 Hosting is the Best Hosting in Australia

In short, DiscountService.biz offer Drupal 11.0.4 friendly hosting solutions which are featured rich, fast, reliable, and affordable. Taking these factors into consideration, DiscountService.biz is strongly recommended for people to host their Drupal 11.0.4 site.
Read More

Discover How to Utilize FileSystemWatcher in ASP.NET 9

Leave a Comment

You can track file changes on a disk or local network device with the aid of File System Watcher. Console applications that respond to modifications based on the files that are copied, erased, altered, or generated can use it.

I set up an example to watch PDF files in the OneDrive default user folder. Make a console application with.

dotnet new console --name myConsoleApp

Add the code below to Program.cs, and you will start monitoring the OneDrive folder on Windows machines.

using System;
using System.IO;
using System.Threading;

class Program
{
    static void Main()
    {
        var fw = new FileSystemWatcher
        {
            Filter = "*.pdf",
            Path = Environment.GetEnvironmentVariable("OneDrive") ?? "C:\\",
            IncludeSubdirectories = true,
            EnableRaisingEvents = true
        };

        fw.Changed += MonikerChange;
        fw.Created += MonikerCreated;

        while (true)
        {
            Thread.Sleep(1000);
        }
    }

    static void MonikerChange(object sender, FileSystemEventArgs e)
    {
        // Handle the file change event
        Console.WriteLine($"File changed: {e.FullPath}");
    }

    static void MonikerCreated(object sender, FileSystemEventArgs e)
    {
        // Handle the file created event
        Console.WriteLine($"File created: {e.FullPath}");
    }
}

Inside the events, you can do whatever you need with the files.

static void MonikerCreated(object sender, FileSystemEventArgs e)
{
    // Handle the file created event
    Console.WriteLine($"File created: {e.FullPath}");
}

To prevent the app from starting more than once, create a Mutex to prevent several instances from running at the same time. You need to create a unique name for your application, replacing UniqueApplicationName.

using (var mutex = new Mutex(true, "UniqueApplicationName", out bool createdNew))
{
    if (!createdNew)
    {
        // Application is already running
        return;
    }

    var fw = new FileSystemWatcher
    {
        Filter = "*.pdf",
        Path = Environment.GetEnvironmentVariable("OneDrive") ?? "C:\\",
        IncludeSubdirectories = true,
        EnableRaisingEvents = true
    };

    fw.Changed += MonikerChange;
    fw.Created += MonikerCreated;

    while (true)
    {
        Thread.Sleep(1000);
    }

    static void MonikerChange(object sender, FileSystemEventArgs e)
    {
        // Handle the file change event
        Console.WriteLine($"File changed: {e.FullPath}");
    }

    static void MonikerCreated(object sender, FileSystemEventArgs e)
    {
        // Handle the file created event
        Console.WriteLine($"File created: {e.FullPath}");
    }
}

You can hide the console screen to avoid the use of terminating the application, and add the code below to the top of the Program.cs.

using System.Runtime.InteropServices;

[DllImport("kernel32.dll")]
static extern IntPtr GetConsoleWindow();

[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

const int SW_HIDE = 0;
const bool HIDE = true;

if (HIDE)
{
    var handle = GetConsoleWindow();
    ShowWindow(handle, SW_HIDE);
}
Conclusion

You can create logs or process files that have been modified, created, deleted, or changed; it's up to you and your requirements to monitor file changes on the hard drive.

Use this resource wisely.

Windows Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest Magento. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2022 R2, SQL Server 2022, ASP.NET Core 8.0 , ASP.NET MVC, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their Magento hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.49/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
 
https://hostforlifeasp.net/
Read More

An Explanation of Webgrid and Gridview in ASP.NET Core and.NET Core

Leave a Comment

The idea behind this is to use query string arguments to sort columns and sort order, as well as to pass page numbers. According to the idea, the server will receive the updated URL if you change the query string or URL and assign window.location = modifiedurl. Using JavaScript and JQuery, we change the URL's page numbers and sort its columns.

You can copy the large JavaScript code here to a new JS file and refer to it.

//For paging use below dummy class in <style> tag
<style>
.Paging{}
</style>
<tr>
 <th width="100px" style="background-color: #337ab7; color: #fff; border-color: #2e6da4;">NoSortCol1</th>
 <th width="100px" style="background-color: #337ab7; color: #fff; border-color: #2e6da4;">NoSortCol2</th>
//instead of looping over month, it is up to you how you use sort expressions sent by controller
 @foreach (string month in @ViewBag.ListMonths)
 {
 string sortExp = @"/ReportController/RevActionMethod?PAGE2=1&SORTDIR2=DESC&SORTCOL2=" + month;
 <th width="100px" style="background-color: #337ab7; color: #fff; border-color: #2e6da4;">
 <a style="color:#fff" href="@sortExp">@month</a>
 </th>
 }
 </tr>
//iterate data here.. above is just header
<tr><td colspan="6" class="Paging"></td></tr>
// Here Paging buttons will be inserted in the above <tr> using Paging class
window.onload = function () {
    appendPaging2('@ViewBag.TotalPages');
    // appendSorting2('Q1FY22');
    appendSorting2('@ViewBag.AllColumns');
};

// Here AllColumns is a ';' separated string of all columns.
// They are the same as all sort expressions in the hyperlink.
// There should not be any space in the sort expression.
// These sort expressions are the sort columns that are passed
// to the server each time we click.

Put the below in a separate JavaScript file.

If $.urlParam = function (name) in the below code is not working, put this function code in the named function.

function appendPaging2(totPages) {
    TotalPages = totPages;
    var pageLink = $('.Paging');
    var curPage = $.urlParam("PAGE2");
    if (curPage == '') curPage = 1;

    pageLink.empty();
    pageLink.append();

    var disable5 = "", disableLast = "", disableNext = "";
    var disableDecr5 = "", disablePrev = "", disableFirst = "";

    if (TotalPages < 5) disable5 = "disabled";
    if (curPage == TotalPages) {
        disableLast = "disabled";
        disableNext = "disabled";
        disable5 = "disabled";
    }
    if (curPage == 1) {
        disableDecr5 = "disabled";
        disablePrev = "disabled";
        disableFirst = "disabled";
    }

    pageLink.append('<input type="submit" name="FIRST" onclick="page(event);" style="margin-left:4px;" class="page-link" value="<<"' + disableFirst + ' />');
    pageLink.append('<input type="submit" name="PREV1" onclick="page(event);" style="margin-left:4px;" class="page-link" value="<"' + disablePrev + ' />');
    pageLink.append('<input type="submit" name="PREV5" onclick="page(event);" style="margin-left:4px;" class="page-link" value="<5"' + disableDecr5 + ' />');
    pageLink.append('<input type="submit" name="NEXT5" onclick="page(event);" style="margin-left:4px;" class="page-link" value="5>"' + disable5 + ' />');
    pageLink.append('<input type="submit" name="NEXT1" onclick="page(event);" style="margin-left:4px;" class="page-link" value=">"' + disableNext + ' />');
    pageLink.append('<input type="submit" name="LAST" onclick="page(event);" style="margin-left:4px;" class="page-link" value=">>"' + disableLast + ' />');
    pageLink.append('<input type="submit" class="page-link" style="background-color:#ccc; margin-left:4px;" value="1" disabled />');
    pageLink.append('<input type="submit" class="page-link" style="background-color:#ccc; margin-left:4px;" value="' + TotalPages + '" disabled />');
    pageLink.children().eq(6).val(curPage);
}

function appendSorting2(liColumns) {
    var allColAry = liColumns.split(";");
    for (let i = 0; i < allColAry.length; i++) {
        $('tr > th > a[href*="SORTCOL2=' + allColAry[i].toString().replace(" ", "") + '"]').attr("onclick", 'setSort2(this);');
    }
    var sortCol = $.urlParam("SORTCOL2");
    var sortDir = $.urlParam("SORTDIR2");
    if (sortDir != "") {
        if (sortDir == "DESC") {
            var txt = $('tr > th > a[href*="SORTCOL2=' + sortCol + '"]').attr('href').toString();
            txt = txt.replace("SORTDIR2=DESC", "SORTDIR2=ASC");
            $('tr > th > a[href*="SORTCOL2=' + sortCol + '"]').attr('href', txt);
            $('tr > th > a[href*="SORTCOL2=' + sortCol + '"]').parent().append("▼");
        } else {
            var txt = $('tr > th > a[href*="SORTCOL2=' + sortCol + '"]').attr('href').toString();
            txt = txt.replace("SORTDIR2=ASC", "SORTDIR2=DESC");
            $('tr > th > a[href*="SORTCOL2=' + sortCol + '"]').attr('href', txt);
            $('tr > th > a[href*="SORTCOL2=' + sortCol + '"]').parent().append("▲");
        }
    }
}

function page(event) {
    var txt = window.location.toString();
    switch (event.target.name.toString()) {
        case 'PREV1':
            // Logic for previous page
            break;
        case 'NEXT1':
            // Logic for next page
            break;
        case 'PREV5':
            // Logic for previous 5 pages
            break;
        case 'NEXT5':
            // Logic for next 5 pages
            break;
        case 'LAST':
            // Logic for last page
            break;
        case 'FIRST':
            // Logic for first page
            break;
        default:
            // Default case
    }
}

function setSort2(e) {
    var type = e.text.toString().replace(" ", "").replace("%", "").replace("(", "").replace(")", "");
    var txtHref = $('tr > th > a[href*="SORTCOL2=' + type + '"]').attr('href').toString();
    txtHref = setURLParams(txtHref);
    txtHref = updateQueryStringParameter(txtHref, 'PAGE2', 1);
    $('tr > th > a[href*="SORTCOL2=' + type + '"]').attr('href', txtHref);
}

function setURLParams(txtHref) {
    var urlTxt = window.location.toString();
    var urlAry = urlTxt.split("?");
    if (urlAry.length > 1) {
        urlTxt = urlAry[1];
        const searchParams = new URLSearchParams(urlTxt);
        for (const key of searchParams.keys()) {
            if (key != "SORTCOL2" && key != "SORTDIR2" && key != "PAGE2") {
                var val = $.urlParam(key);
                txtHref = updateQueryStringParameter(txtHref, key, val);
            }
        }
    }
    return txtHref;
}

function updateQueryStringParameter(uri, key, value) {
    var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
    var separator = uri.indexOf('?') !== -1 ? "&" : "?";
    if (uri.match(re)) {
        return uri.replace(re, '$1' + key + "=" + value + '$2');
    } else {
        return uri + separator + key + "=" + value;
    }
}

$.urlParam = function (name) {
    var results = new RegExp('[?&]' + name + '=([^&#]*)').exec(window.location.search);
    return results !== null ? results[1] || 0 : false;
};
// we have to use bootstrap and styling of paging is automatically taken care
//add this extra property in bootstrap .page-link
//I copied all styling related to paging in separate file from bootstrap (cut paste)
.page-link {
  float: left;
}
 

Windows Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest Magento. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2022 R2, SQL Server 2022, ASP.NET Core 7.0.10 , ASP.NET MVC, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their Magento hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.49/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
 
https://hostforlifeasp.net/
Read More

Comprehending Binary Serialization in.NET

Leave a Comment

What is Serialization?

Serialization is the process of converting an object into a stream of bytes, which can be stored or transmitted. This stream of bytes can then be deserialized back into an object. Serialization is crucial for various tasks, such as:

  1. Storing objects: Saving objects to disk or database.
  2. Transmitting objects: Sending objects over a network.
  3. Passing objects between application domains: Sharing objects between different parts of an application.

What is Binary Serialization?

Binary serialization is a process that converts complex objects into a linear sequence of bytes. This serialized data can be stored or transmitted and later deserialized to restore the original object's structure and state.

Why Use Binary Serialization?
  1. Efficiency: Binary serialization produces compact representations of data, leading to smaller file sizes and faster data transfer.
  2. Performance: Deserializing binary data is significantly faster than text-based formats, optimizing application performance.
  3. Interoperability: Binary serialized data can be readily parsed and interpreted across various programming languages and platforms, promoting data exchange and compatibility.
How to use Binary Serialization?

Let me explain with an example.

Step 1. Create a class named Customer and mark the class as [Serializable].

[Serializable]
public class Customer
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
}

The [Serializable] attribute marks the class as serializable.

Step 2. Create a generic interface named ITransform<T>.

public interface ITransform<T>
{
    public void Serialize(T obj, string filePath);
    public T Deserialize(string filePath);
}

It contains two abstract methods.

  1. Serialize: Accepts a generic object and a string as input.
  2. Deserialize: Accepts a string as input.

Step 3. Extend & implement the ITransform<T> interface.

public class BinarySerializer<T>: ITransform<T> where T: class
{
    public void Serialize(T obj, string filePath)
    {
        using var stream = new FileStream(filePath, FileMode.Create);

        var formatter = new BinaryFormatter();
        formatter.Serialize(stream, obj);

    }
    public T Deserialize(string filePath)
    {
        using var stream = new FileStream(filePath, FileMode.Open);

        var formatter = new BinaryFormatter();
        return (T)formatter.Deserialize(stream);

    }
}

Code explanation

void Serialize(T obj, string filePath)

  1. T obj: This is a generic parameter T representing the object to be serialized. This means the method can serialize any object type that is compatible with the BinaryFormatter.
  2. string filePath: This is the path to the file where the serialized data will be stored.
  3. using var stream = new FileStream(filePath, FileMode.Create)
    • This line creates a new FileStream object named stream.
    • The filePath parameter specifies the path to the file where the serialized data will be written.
    • The FileMode.Create flag ensures that a new file is created at the specified path. If a file with the same name already exists, it will be overwritten.
  4. var formatter = new BinaryFormatter()
    • This line creates a new instance of the BinaryFormatter class. This class is used to serialize and deserialize objects in binary format.
  5. formatter.Serialize(stream, obj);
    • This line calls the Serialize method of the BinaryFormatter object to serialize the obj object into the stream.
    • The BinaryFormatter converts the object into a sequence of bytes and writes these bytes to the file stream.

T Deserialize(string filePath)

  1. The stored file is opened using the FileStream object.
  2. formatter.Deserialize(stream): This method retrieves the object data from the open file stream (stream) using the BinaryFormatter.The deserialized object is cast to the generic type T specified in the method signature.

Step 4. Create an object of customer class and perform the Serialization & Deserialization.

var customer = new Customer
{
    FirstName = "Ethan",
    LastName = "Jackson"
};

ITransform<Customer> serializer = new BinarySerializer<Customer>();
serializer.Serialize(customer, "customer");
  1. A customer object is created.
  2. Instantiated a BinarySerializer<Customer> object and assigned it to the serializer variable, which is of type ITransform<Customer>.
  3. The Serialize method is invoked, passing the customer object and the desired filePath as arguments. The method serializes the customer object and writes the resulting data to the specified file.

Step 5. Run the code and open the file named customer.

Output

Step 6. Deserialization.

var deserializedCustomer = serializer.Deserialize("customer");
Console.WriteLine($"Customer: {deserializedCustomer.FirstName}, {deserializedCustomer.LastName}");

To deserialize the data, the file path containing the serialized data is passed as a parameter to the Deserialize method.

Step 7. Run the code.

By understanding the concepts and best practices of binary serialization in .NET, you can effectively store, transmit, and retrieve your object data in a compact and efficient manner.

Note. The Serialize and Deserialize methods associated with the BinaryFormatter class were marked as obsolete from .NET 7 onwards. This means they are no longer recommended for use due to security vulnerabilities.

Happy Coding!

Windows Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest Magento. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2022 R2, SQL Server 2022, ASP.NET Core 8.0 , ASP.NET MVC, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their Magento hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.49/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
 
https://hostforlifeasp.net/
Read More

SharePoint 2013 Tutorial: How to Create a ListView Command Set Extension?

Leave a Comment

A ListView Command Set extension in SharePoint allows you to customize the command bar (toolbar) of lists or libraries by adding new actions. These actions can be tailored to perform custom business logic, navigate users to specific locations, or integrate with external systems.

Key features of a ListView Command Set
  1. Custom Commands
    • Add new buttons to the command bar or context menu in list/library views.
    • Define actions triggered by these commands.
  2. Context-Sensitive Actions: Execute different logic based on the selected item(s) or list context.
  3. Integration: Connect with third-party APIs, open dialogs, or launch forms.
Steps to Create a ListView Command Set

Step 1. Generate the SPFx Extension.

yo @microsoft/sharepoint
PowerShell

Step 2. When prompted, enter the following values.

  • What is your solution name?: command-extension
  • Which type of client-side component to create?: Extension
  • Which type of client-side extension to create?: ListView Command Set
  • What is your Command Set name?: HelloWorld

Step 3. Open the file ./src/extensions/helloWorld/HelloWorldCommandSet.ts.

Modify the onExecute method to define the action triggered by your custom command.

public onExecute(event: Command): void {
    switch (event.itemId) {
      case 'COMMAND_1':
        alert('Command 1 executed!'); // Replace with your logic
        break;
      case 'COMMAND_2':
        const selectedItems = this.context.listView.listViewItems;
        if (selectedItems.length > 0) {
          alert(`Selected item(s): ${selectedItems.map(item => item.getValueByName('Title')).join(', ')}`);
        } else {
          alert('No items selected.');
        }
        break;
      default:
        throw new Error('Unknown command');
    }
}

Step 4. Update the Manifest.

Open the ./src/extensions/helloWorld/HelloWorldCommandSet.manifest.json file.

This file defines your extension type and a unique identifier id for your extension. You need this unique identifier later when debugging and deploying your extension to SharePoint.

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json",
  "id": "your-extension-guid",
  "componentType": "Extension",
  "extensionType": "ListViewCommandSet",
  "version": "1.0.0.0",
  "manifestVersion": 2,
  "items": {
    "COMMAND_1": {
      "title": "Alert",
      "iconImageUrl": "https://cdn-icons-png.flaticon.com/512/1828/1828884.png",
      "type": "command"
    },
    "COMMAND_2": {
      "title": "Show Selected Items",
      "iconImageUrl": "https://cdn-icons-png.flaticon.com/512/126/126483.png",
      "type": "command"
    }
  }
}

Step 5. Open ./config/serve.json file. Update the page URL attributes to match the URL of the list where you want to test the solution.

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
  "port": 4321,
  "https": true,
  "serveConfigurations": {
    "default": {
      "pageUrl": "https://<YourTenantName>.sharepoint.com/sites/<YourSiteName>/Lists/<YourListName>/AllItems.aspx",
      "customActions": {
        "bf232d1d-279c-465e-a6e4-359cb4957377": {
          "location": "ClientSideExtension.ListViewCommandSet.CommandBar",
          "properties": {
            "sampleTextOne": "One item is selected in the list",
            "sampleTextTwo": "This command is always visible."
          }
        }
      }
    },
    "helloWorld": {
      "pageUrl": "https://<YourTenantName>.sharepoint.com/sites/<YourSiteName>/Lists/<YourListName>/AllItems.aspx",
      "customActions": {
        "bf232d1d-279c-465e-a6e4-359cb4957377": {
          "location": "ClientSideExtension.ListViewCommandSet.CommandBar",
          "properties": {
            "sampleTextOne": "One item is selected in the list",
            "sampleTextTwo": "This command is always visible."
          }
        }
      }
    }
  }
}

Step 6. Build, Package, and Deploy.

Run the following commands one by one.

gulp build
gulp bundle --ship
gulp package-solution --ship
Bash

Step 7. Upload the package.

Upload the .sppkg file from the SharePoint/solution folder to your App Catalog.

Step 8. Navigate to the SharePoint list or library where the extension is applied.

  • Look for the new commands added to the toolbar or context menu.
  • Execute the commands and verify their functionality.

Output

Command 1. When you click on "Alert", a simple alert message appears.

“Command 1 executed!”

Command 2. When you select one or more items in the list and click "Show Selected Items," it displays the titles of the selected items in an alert box.

Conclusion

A ListView Command Set extension is a simple and effective way to add custom actions to SharePoint lists and libraries. It lets you create buttons that perform specific tasks, like automating workflows, showing custom messages, or connecting to other systems.

SharePoint Hosting Recommendation
One of the most important things when choosing a good SharePoint hosting is the feature and reliability. HostForLIFE is the leading provider of Windows hosting and affordable SharePoint, their servers are optimized for PHP web applications such as the latest SharePoint version. The performance and the uptime of the hosting service are excellent and the features of the web hosting plan are even greater than what many hosting providers ask you to pay for. 

At HostForLIFE.eu, customers can also experience fast SharePoint hosting. The company invested a lot of money to ensure the best and fastest performance of the datacenters, servers, network and other facilities. Its datacenters are equipped with the top equipments like cooling system, fire detection, high speed Internet connection, and so on. That is why HostForLIFE.eu guarantees 99.9% uptime for SharePoint. And the engineers do regular maintenance and monitoring works to assure its SharePoint hosting are security and always up. 

http://hostforlifeasp.net

Read More
Previous PostOlder Posts Home