Wednesday 5 June 2019

Copy Current url to clipboard using Javascript


function copyLinkWhatsup()
    {

        var dummy = document.createElement('input'),
          text = window.location.href;
        document.body.appendCh

Monday 3 June 2019

Put links in head section of view



When you work in ASP.Net MVC and you want to put links in head section but it appears after many links this is because head section code comes from shared layout. 

So if you want to add some links at the top in a view head section you need to make a render point in shared layout with a unique name and put your links inside of given name section.

Layout section 



@RenderSection("GCSS", required: false)
@RenderSection("og", required: false)


Razor/View Section

Tuesday 7 May 2019

Show Serial number for Table column

Some time we retrieve data from the database and render in the table and we want to show serial number, then this article will help you to show the serial number using foreach loop  using razor.



<table class="table table-bordered table-hover">
    <thead>

Sunday 21 April 2019

Display DB Error message php


By default PHP doesn’t show run time error. You will have to set error method as follows


// first set general PHP error reporting
// in order to be sure we will see every error in the scriptini_set('display_errors',1);error_reporting(E_ALL);
/*** THIS! ***/mysqli_report(MYSQLI_REPORT_ERROR MYSQLI_REPORT_STRICT);/*** ^^^^^ ***/$db $mysqli = new mysqli($host$user$pass$database);
$res $db->query("apparently not valid SQL string");$res->fetch_assoc();