Monday, April 29, 2024

SQL Server find current year - Previous Year

  SELECT        TimePeriod

          FROM            (SELECT        YEAR(GETDATE()) AS TimePeriod

          UNION

          SELECT        YEAR(GETDATE()) - 1 AS Expr1

          UNION

          SELECT        YEAR(GETDATE()) - 2 AS Expr1

          UNION

          SELECT        YEAR(GETDATE()) - 3 AS Expr1

          UNION

          SELECT        YEAR(GETDATE()) - 4 AS Expr1) AS t

          ORDER BY TimePeriod DESC

Tuesday, April 23, 2024

HTML colsapn and rowspan in table header - table with multiple headers

 <!DOCTYPE html>

<html>

<head>

</head>

<body>

<table style="width:100%">

<tr>

    <th rowspan="3">SL.No.</th>

    <th rowspan="3">ZONE</th>

    <th rowspan="3">BRANCH (Cummulative MPR)</th>

Saturday, April 20, 2024

Powershell examles

 https://github.com/gangstanthony/

How to find duplicate values in Excel

 >Open MS Excel

> Select one , two or more columns

> Click on "Conditional Formatting"

> Click on "Highlight cells rules"

> Click on "Duplicate Values"

Thursday, April 18, 2024

How to play sounds in asp.net and javascript (beep sound)

In asp.net

  Console.Beep(); 

ref:- https://stackoverflow.com/questions/3502311/how-to-play-a-sound-in-c-net


Also in javascript we can convert mp3 file to base64


ref:- https://base64.guru/converter/encode/audio/mp3


https://stackoverflow.com/questions/35497243/how-to-make-a-short-beep-in-javascript-that-can-be-called-repeatedly-on-a-page


https://www.geeksforgeeks.org/how-to-make-a-beep-sound-in-javascript/


https://stackoverflow.com/questions/7620871/how-to-play-a-sound-with-js


https://stackoverflow.com/questions/21775563/playing-sound-inside-javascript-event

Spinner loader masking - bootstrap - with gif image

with bootstrap class 

 .spinner-grow{

           display: block;

              position: fixed;

              z-index: 1031; /* High z-index so it is on top of the page */

              top: 50%;

              right: 50%; /* or: left: 50%; */

        }

        .model {

            display: none;

            position: fixed;

            z-index: 1200;

            top: 0;

            left: 0;

            height:

Monday, April 15, 2024

Fetch API Javascript Post - How to get text from file in javascript



 https://stackoverflow.com/questions/49823763/handle-asmx-c-sharp-exception-with-fetch-api


https://stackoverflow.com/questions/51291831/fetch-api-call-causes-new-asp-net-session


https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_api_fetch_easy

with ajax fetch api

https://stackoverflow.com/questions/60349890/jquery-async-await-ajax-call

https://stackoverflow.com/questions/27612372/how-to-await-the-ajax-request


<script>

getText("fetch_info.txt");


async function getText(file) {

  let myObject = await fetch(file);

  let myText = await myObject.text();

  document.getElementById("demo").innerHTML = myText;

}


or


CSS to background to black and loader by dev

 <body>

<div class="container1">

<div class="ring"></div>

        <div class="ring"></div>

        <div class="ring"></div>

        <p>Loading...</p>

</div>

</body>

Javascript From and To datepicker validation

  var now = new Date();

    var month = (now.getMonth() + 1);

    var day = now.getDate();

    if (month < 10)

        month = "0" + month;

    if (day < 10)

        day = "0" + day;

    var dateFrom = '01' + '-' + month + '-' + (now.getFullYear());

    var dateTo = day + '-' + month + '-' + now.getFullYear();

    $('#dateFrom').val(dateFrom);

    $('#dateTo').val(dateTo);

    $('[id*=dateFrom]').datepicker({

        changeMonth: true,

        changeYear: true,

        format: "dd-mm-yyyy",

        language: "tr",

        todayHighlight: true,

        autoclose: true,

        isRTL: true,

        endDate: dateTo

    })

Friday, April 12, 2024

How to find the ID from the control in JAvascript

 $('[id$=hfUserVsRoleValue]').attr('id')


use attr attribute 

How to get the value of dropdown multiselect and shown into label HTML and Javascript

 <select id="ddlBranch" multiple="multiple" class="form-select form-select-sm form-control"></select>


var BrList = [];

 $.each($("#ddlBranch option:selected"), function () {

        BrList.push($(this).text());

    });


$("#lblBranch").text(BrList.join(","));

How to set value of label in HTML and Jquery and how to get value of textbox html

Set Value of label

<label id="lblZone" class="fst-italic fw-medium text-danger">test</label>


 $("#lblZone").text('Test');


get value from textbox

<input class="form-control datepickerIcon" id="dateFrom" type="text" />

$('#lblFromDate').text($('#dateFrom').val());

How to create dropdown with multi select in HTML and javascript and JQuery

<select id="ddlZone" multiple="multiple" class="form-select form-select-sm form-control"></select>


$(document).ready(function () {

    $('#ddlZone').multiselect({

        includeSelectAllOption: true,

        enableFiltering: true,

        maxHeight: 600,

        //dropUp: true,

        buttonWidth: '250px',

        enableCaseInsensitiveFiltering: true,

        onDropdownHidden: function (event) {

            ddlZone_onClientDropDownClosed();

            //GetDashBoardSummary();

        },

        templates: {

            button: '<button type="button" class="form-select multiselect dropdown-toggle btn-sm" data-bs-toggle="dropdown" aria-expanded="false" style=" border: 1px solid #dee2e6; border-radius: 15px;"><span class="multiselect-selected-text"></span></button>',

        },

    });

});

Monday, April 8, 2024

Accordion Nested in bootstrap - Ul li a - Menu sub menu - Navbar

Nested with four nested


  <div class="accordion" id="accordionMenu">

        <div class="accordion-item">

            <h2 class="accordion-header " id="headingMonthlyReports">

                <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseMonthlyReports" aria-expanded="false" aria-controls="collapseMonthlyReports">A. Monthly Reports</button>

            </h2>

            <div id="collapseMonthlyReports" class="accordion-collapse collapse" >

                <div class="accordion-body">

                    <div class="accordion-item">

                        <div class="accordion-body">

                            <a href="../CourtApplicationInitialDetails.aspx">1. Monthly Performance Report-I (MPR-I)</a>

                        </div>

                    </div>

                    <!-- Main Monthly Performance Report I-->

                    <div class="accordion-item">

                        <h2 class="accordion-header" id="headingMPR2">

                            <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseMPR2" aria-expanded="false" aria-controls="collapseMPR2">2. Monthly Performance Report - II (MPR-II)</button>

Android Color to black and white

> In android, Go to settings

> Search for Greyscale

> Click on Color Correction

> You can change colors

Thursday, April 4, 2024

In window 11, How to change time to milliseconds

> Right click on Taskbar

 > Go to Taskbar settings "Show seconds"

And there are many options 'to left the menu of desktop from centre'

Tuesday, April 2, 2024

How to style label or linkbutton in ASP.NET in C#

   lnkAppCNRno.Attributes.CssStyle[HtmlTextWriterStyle.BackgroundColor] = "unset !important";

                    lnkAppCNRno.Attributes.CssStyle[HtmlTextWriterStyle.TextDecoration] = "none";

                    lnkAppCNRno.Attributes.CssStyle[HtmlTextWriterStyle.Cursor] = "default";