Skip to main content

Posts

Login Using ADO.NET MVC

In this article of ASP.NET MVC we will learn about login functionality using ADO.NET so let's start. Firstly create Model Class,in my case i create class namely called Employee and hit the code: using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace SignIn_SignUp_Using_AdoDotNet.Models {     public class Employee     {         public int id { get; set; }         public string UserName { get; set; }         public string UserPassword { get; set; }     } } Then create a controller and hit the code below: using SignIn_SignUp_Using_AdoDotNet.Repository; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Web.Mvc; using System.Web.DynamicData; using SignIn_SignUp_Using_AdoDotNet.Models; namespace SignIn_SignUp_Us...

Auto Complete in ASP.NET MVC Using Jquery Ajax

In this article of ASP.NET MVC we will learn about AutoComplete textbox using ajax and jquery: Firstly make a connection with database.In my case i have used Entity Model. Then create a Controller,my case i create HomeController: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using test.Models; namespace test.Controllers {     public class HomeController : Controller     {          EmpEntities db = new EmpEntities();         public ActionResult Index()         {             return View();         }         public ActionResult getffvalue(string searchInput)         {             ...

File Uploading in C#

In this article of ASP.NET MVC we will learn about Validation File Uploading so Let's start. Firstly create Model Class, In my case there are two classes like EmpModel and FileDetailsModel EmpModel Class: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace File_Upload.Models {     public class EmpModel     {         [Required]         [DataType(DataType.Upload)]         [Display(Name = "Select File")]         public byte files { get; set; }     } } FileDetailsModel Class: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace File_Upload.Models {     public class FileDetailsMo...

SQL - SELECT

In this article of SQL  we will learn about Selection so Let's start.     If we want to retrieve all database record then we use : Select * from table_name.   If we want to retrieve particular record then: Select * from table_name where Customerid = 1   The following SQL statement selects only "Employee Id" and "Name" columns from the "Employee" table:  Select  EmployeeId and Name from Employee. SELECT - DISTINCT It is use to return distinct(different) values   The following SQL statement selects only the DISTINCT values from the "EmployeeName" column in the "Employee" table:  Select distinct EmployeeName from Employee;   Let's say we want to count distinct Employee Name then: Select Count(Distinct EmployeeName) from Employee;

Jquery - Css

In this article of Jquery we will learn about Css so Let's start. @{     ViewBag.Title = "Css"; } <!DOCTYPE html> <html> <head>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>     <script src="~/js/CssClasses.js" type="text/javascript"></script>     <style>         .important{             font-weight :bold;             font-size:xx-large;         }         .blue{             color:blue;         }         .grey{           ...

Jquery - Event

In this article of Jquery we will learn about Event so Let's start. @{     ViewBag.Title = "Events"; } <h2>     Events </h2> <!DOCTYPE html> <html> <head>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>     <script src="~/js/Event.js" type="text/javascript"></script> </head> <body>     <!--The function is executed when the user double-clicks on the HTML element:-->     <h3>The function is executed when the user double-clicks on the HTML element:</h3>     <p>This is para</p>     <p>Second para</p>     <p>Third para</p>     <!--End-->     <br /><br /><br /><br /><br /><br /> ...

Jquery - Add

In this article of Jquery we will learn about Add Element so Let's start. @{     ViewBag.Title = "Index"; } <h2>Add</h2> <!DOCTYPE html> <html> <head>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>     <script src="~/js/Add.js" type="text/javascript"></script> </head> <body>    <button id="append">Enter</button>     <img src="~/img/w3jquery.gif" id="img" width="100" height="150"/> <button id="after">Insert after Image text</button> <script> $(document).ready(function () {     $("#append").click(function () {         var text = "<b>Text</b>";         $("body").append(text)     });     $("#after").clic...

Jquery - CallBack

In this article of Jquery we will learn about CallBack so Let's start. @{     ViewBag.Title = "Call Back"; } <h2>Call Back</h2> <!DOCTYPE html> <html> <head>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>     <script src="~/js/CallBack.js" type="text/javascript"></script> </head> <body>     <!--The example below has a callback parameter that is a function that will be executed after the hide effect is completed:-->     <h3>The example below has a callback parameter that is a function that will be executed after the hide effect is completed:</h3>     <p id="firstpara">This is para</p>     <button id="firstbtn">Enter</button>     <!--End-->     <br /><br /...

Jquery - Chaining

In this article of Jquery we will learn about Chaining so Let's start. @{     ViewBag.Title = "Chaining"; } <h2>Chaining</h2> <!DOCTYPE html> <html> <head> </head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="~/js/Chaining.js" type="text/javascript"></script> <body>     <!--The following example chains together the css(), slideUp(), and slideDown() methods. The "p1" element first changes to red, then it slides up, and then it slides down:-->     <h3>The following example chains together the css(), slideUp(), and slideDown() methods. The "p1" element first changes to red, then it slides up, and then it slides down:</h3>     <p id="firstpara">Hello ! ! !</p>     <button id="firstbtn">Enter</button>     <!--...

Jquery - Remove

In this article of Jquery we will learn about Remove Element so Let's start. @{     ViewBag.Title = "Remove"; } <h2>Remove</h2> <!DOCTYPE html> <html> <head>     <style>         #firstDiv {         border:1px solid black;         width:200px;         height:200px;         }         #secondDiv {             border: 1px solid black;             width: 200px;             height: 200px;         }         .test {         color...

Introduction to SQL

What is SQL ? SQL stands for structured query language.It's allow to access database.It can perform several operation like creation,read,update and delete.We can also create store procedure in it In this article we will learn about database and also learn to manipulate database. So let's Get Start.

Jquery - Add Element

In this article we will learn about Jquery Add Element: 1) append() => Insert content at the end. 2) prepend() => Insert content at the beginning. 3) after() => Insert content after  selected element. 4) before() => Insert content before selected element. Append() Method: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){   $("#btn").click(function(){     $("p").append(" <b>Appended text</b>.");   }); }); </script> </head> <body> <p></p> <button id="btn">Append text</button> </body> </html> Prepend() Method: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <scr...

Jquery Slide

In this article we will learn about Jquery Slide: There are three method to sliding effect 1) slideDown() 2) slideUp() 3) slideToggle() Slide Down: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){   $("#sliding").click(function(){     $("#panel").slideDown("slow");   }); }); </script> <style> #panel, #sliding {   padding: 5px;   text-align: center;   background-color: red;   border: solid 1px #c3c3c3; } #panel {   padding: 50px;   display: none; } </style> </head> <body> <div id="sliding">Click here slide down panel</div> <div id="panel">Hello</div> </body> </html> Slide Up: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.j...

Jquery Fade

In this article we will learn about Jquery Fade: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){   $("button").click(function(){     $("#div1").fadeIn();     $("#div2").fadeIn("slow");     $("#div3").fadeIn(3000);   }); }); </script> </head> <body> <button>Click me</button><br><br> <div id="div1" style="width:80px;height:80px;display:none;background-color:red;"></div> </body> </html>

Jquery Hide and Show

In this article we will learn about Jquery Hide/Show: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){   $("#hide").click(function(){     $("p").hide();   });   $("#show").click(function(){     $("p").show();   }); }); </script> </head> <body> <p>Hello</p> <button id="hide">Hide</button> <button id="show">Show</button> </body> </html>

Element Selector in Jquery

In this article we will learn about Element Selector <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){   $("button").click(function(){     $("p").hide();   }); }); </script> </head> <body> <h2>This is a heading</h2> <button>Click to hide paragraphs</button> </body> </html>

Session in Asp.net Mvc

In this article we will discuss about Sessions: Firstly create Model, SignUp and Db Class: SignUp Class: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Web; namespace Session.Models {     [Table("tbl_account")]     public class SignUp     {         public int id { get; set; }         public string name { get; set; }         public string email { get; set; }         public string password { get; set; }     } } Db Class: using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; namespace Session.Models {     public class db:DbContext     {         public Db...

Model Binding in Asp.net Mvc

In this article we will learn about Model Binding,Let's start. First Add  Model Class namely called Student in my case. using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Model_Binding.Models {     public class Student     {         public int Id { get; set; }         public string Name { get; set; }         public string Gender { get; set; }     } } Now add  Controller: using Model_Binding.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Model_Binding.Controllers {     public class HomeController : Controller     {         // GET: Home         public ActionResult Index() ...

Database_First Approach Using Entity Framework in Asp.net Mvc

Firstly,you need to install entityframework from "Manage Nuget Packages for Solution". Model Class: Company.cs: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Web; namespace Database_First_Approach.Models {     [Table("tblCompany")]     public class Company     {         public int id { get; set; }         public string Name { get; set; }         public string Location { get; set; }     } } CompanyContext.cs: using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; namespace Database_First_Approach.Models {     public class CompanyContext:DbContext     {         public DbSet<Company> companies { get; set; }     } } Then make a connection file with your dat...

SignIn_SignUp in Asp.net Mvc

Models: SignUp Class: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Web; namespace Signin_Signup.Models {     [Table("tbl_account")]     public class SignUp     {         public int id { get; set; }         public string name { get; set; }         public string email { get; set; }         public string password { get; set; }     } } DB Class: using System; using System.Collections.Generic; using System.Data.Entity; using System.Linq; using System.Web; namespace Signin_Signup.Models {     public class db:DbContext     {         public DbSet<SignUp> signups { get; set; }     } } User Controller: using Signin_Signup.Models; using System; using System.Collections.Generic; using System.L...