Saturday 28 November 2020

ASP.Net 404 page not found error handle

 



When a URL hits and if page is not found on the server then ASP.Net throws a 404 page not found exception. If 404 page not found exception handled properly then you will get the default error page by ASP.Net , Which doesn't looks good and user friendly. 404-page handling is considered as a good practice of web development. Paste the following code on Global asax file and you will be redirected to your custom error page. 

Tuesday 10 November 2020

Google Captcha for C# ASP.Net MVC

 

reCAPTCHA uses an advanced risk analysis engine and adaptive challenges to keep malicious software from engaging in abusive activities on your website. Meanwhile, legitimate users will be able to login, make purchases, view pages, or create accounts and fake users will be blocked.

Saturday 7 November 2020

HTML Table to Excel


jquery.table2excel.min.js is jquery library which has inbuilt functionality to expert any HTML table to Excel file by table id. This is one of the simplest solutions available on the internet totally free of cost. 


 <html>
<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Girfa HTML to Excel</title>

     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"> </script>

<script src="https://cdn.rawgit.com/rainabba/jquery-table2excel/1.1.0/dist/jquery.table2excel.min.js"> </script>

<script>  

  function tbltoexcel()

Monday 5 October 2020

Form post ASP.Net | C# | MVC

 


HTTP is a protocol that is used to provide a communication interface between server and client. HTTP sends data to the server and retrieved response to the client(Browser). HTTP has many methods for client/server communication.

HTTP GET and HTTP Post is the most common method used by HTTP. 

  • HTTP Get the return response from the server to  client.
  • HTTP Post send data client (Browser to the server) .
I am going to explain to you that how can you save data of a form using form post methods. I was a PHP developer when used the MVC C# form then I had to use ajax for data submission to the server which was very time taking and prone to error.


ASP.Net MVC C# has a built-in model attached view for form data submission and validation, which is good but not good as for users who are using simple posts form the method. So I will show you different ways to send data to the server using form method post like PHP.

Demo Table Name (Student)


SN

Field

Data Type

1

Roll

Int

2

Name

Varchar(50)

3

City

Varchar(50)

Store Procedure