Thursday, 15 December 2022

FormsAuthentication C# ASP.NET MVC

 


FormsAuthentication

FormsAuthentication class from System.Web.Security is used to authenticate a user whether login or not. FormsAuthentication class has many functions to check the user login and it's very easy to implement. Follow the code given below

Views

<h2>Login</h2>

<form method="post">

    <input type="text" name="UserName" placeholder="User Name"  required /><br /><br />

    <input type="password" name="Password" placeholder="Password" required /><br /><br />

    <input type="submit" value="Login" />

    @if (Request.QueryString["msg"] != null)

    {

        <br /><br />

        <span style="color:red">@Request.QueryString["msg"]</span>

    }

</form>

Monday, 12 December 2022

How to insert into a table with just one IDENTITY column? SQL Server

 I have a table named Slider, Which stores my website's homepage slider image. So I need one column auto-increment identity field for the slider image record and the uploaded image will be renamed as the identity field value.

So I had to insert a row in a single-column auto increment field. I have achieved this by the query given below.

INSERT INTO [dbo].[Slider]  DEFAULT VALUES 

Next Topic

Monday, 28 November 2022

Editable Table Jquery

Name Value
Lorem Ipsum

Source Code

<html>

<head>

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

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

    <title>Editable Table</title>

   

Saturday, 12 November 2022

Select A Table all rows by checkbox using jquery

Select/Unselect  Table all row by clicking the checkbox using jquery. You can do this by class selector. Make a class and apply it on all checkbox and select or unselect using class name by just one line of code.

Name City
Ram Vns
Syam Alld
Gita LKO
Anita Vns

Code

<html>

<head>

    <title>Table Select</title>

    <style>

        .chk {

        }

    </style>