Validations In asp.net With Text focus Using Jquery

Step1:- Validations on jquery
$(document).ready(function () {
            $("#btnSave").click(function () {
                var firstName = $("#txtFirstName").val();
                var lastName = $("#txtLastName").val();
                var Email = $("#txtEmail").val();
                var password = $("#txtPassword").val();
                var confirmPassword = $("#txtConfirmPassword").val();
                var Gender = $("#ddlGender option:selected").text();
                if (firstName == "" && lastName == "" && Email == "" && password == "" &&        confirmPassword == "" && Gender == "Select Gender")
                {
                    $("#txtFirstName").css("border-color", "red");
                    $("#txtLastName").css("border-color", "red");
                    $("#txtEmail").css("border-color", "red");
                    $("#txtPassword").css("border-color", "red");
                    $("#txtConfirmPassword").css("border-color", "red");
                    $("#ddlGender").css("border-color", "red");
                    return false;
                }
            });
        });

Validations In ASP.NET Using Jquery

STEP1:- Jquery validations using button click
<script src="Scripts/jquery-3.1.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnSave").click(function () {
                var firstName = $("#txtFirstName").val();
                var lastName = $("#txtLastName").val();
                var Email = $("#txtEmail").val();
                var password = $("#txtPassword").val();
                var confirmPassword = $("#txtConfirmPassword").val();
                var Gender = $("#ddlGender option:selected").text();
                if (firstName == "") {
                    alert("First Name Required");
                }
                else if (lastName == "") {
                    alert("Last Name Required");
                }
                else if (Email == "") {
                    alert("Email Required");
                }
                else if (password == "") {
                    alert("Password Required");
                }
                else if (confirmPassword == "") {
                    alert("Confirm Password Required");
                }
                else if (Gender == "Select Gender") {
                    alert("Gender Required");
                }
            });
        });
    </script>

GridView Using StoredProcedure With Templatefield In ASP.NET

In this article i show you how to use gridview with templatefields  in asp.net
step1:-Create table
CREATE TABLE tblEmp
(
Id  int primary key identity,
FirstName   varchar(50),
LastName   varchar(50),
Designation   varchar(50),
Salary          int,
City   varchar(50),
)
Step2:-Insert some data in table

INSERT INTO tblEmp VALUES('SIVA','Garika','UiDeveloper',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Narayana','Garika','Developer',25000,'Hydarabad')
INSERT INTO tblEmp VALUES('Kiran','Thota','Developer',35000,'Hydarabad')
INSERT INTO tblEmp VALUES('Madhu','Thota','Developer',19000,'Hydarabad')
INSERT INTO tblEmp VALUES('Manasa','Javisetty','Testar',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Malavika','Dongari','Developer',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Mounika','Javisetty','Testar',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Anji','Dongari','Developer',25000,'Hydarabad')
INSERT INTO tblEmp VALUES('Aravind','Choodi','Developer',32000,'Hydarabad')
INSERT INTO tblEmp VALUES('Avinash','Choodi','Developer',26000,'Hydarabad')

GridView Using StoredProcedure With DataBoundControls In ASP.NET

In this article i show you how to use gridview with sqldatareader and databound controls  in asp.net
step1:-Create table
CREATE TABLE tblEmp
(
Id  int primary key identity,
FirstName   varchar(50),
LastName   varchar(50),
Designation   varchar(50),
Salary          int,
City   varchar(50),
)
Step2:-Insert some data in table

INSERT INTO tblEmp VALUES('SIVA','Garika','UiDeveloper',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Narayana','Garika','Developer',25000,'Hydarabad')
INSERT INTO tblEmp VALUES('Kiran','Thota','Developer',35000,'Hydarabad')
INSERT INTO tblEmp VALUES('Madhu','Thota','Developer',19000,'Hydarabad')
INSERT INTO tblEmp VALUES('Manasa','Javisetty','Testar',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Malavika','Dongari','Developer',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Mounika','Javisetty','Testar',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Anji','Dongari','Developer',25000,'Hydarabad')
INSERT INTO tblEmp VALUES('Aravind','Choodi','Developer',32000,'Hydarabad')
INSERT INTO tblEmp VALUES('Avinash','Choodi','Developer',26000,'Hydarabad')

GridView Using StoredProcedure With Dataset In ASP.NET

In this article i show you how to use sqldatareader in asp.net
step1:-Create table
CREATE TABLE tblEmp
(
Id  int primary key identity,
FirstName   varchar(50),
LastName   varchar(50),
Designation   varchar(50),
Salary          int,
City   varchar(50),
)
Step2:-Insert some data in table

INSERT INTO tblEmp VALUES('SIVA','Garika','UiDeveloper',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Narayana','Garika','Developer',25000,'Hydarabad')
INSERT INTO tblEmp VALUES('Kiran','Thota','Developer',35000,'Hydarabad')
INSERT INTO tblEmp VALUES('Madhu','Thota','Developer',19000,'Hydarabad')
INSERT INTO tblEmp VALUES('Manasa','Javisetty','Testar',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Malavika','Dongari','Developer',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Mounika','Javisetty','Testar',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Anji','Dongari','Developer',25000,'Hydarabad')
INSERT INTO tblEmp VALUES('Aravind','Choodi','Developer',32000,'Hydarabad')
INSERT INTO tblEmp VALUES('Avinash','Choodi','Developer',26000,'Hydarabad')

GridView Using StoredProcedure With Sqldatareader In ASP.NET

In this article i show you how to use sqldatareader in asp.net
step1:-Create table
CREATE TABLE tblEmp
(
Id  int primary key identity,
FirstName   varchar(50),
LastName   varchar(50),
Designation   varchar(50),
Salary          int,
City   varchar(50),
)
Step2:-Insert some data in table

INSERT INTO tblEmp VALUES('SIVA','Garika','UiDeveloper',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Narayana','Garika','Developer',25000,'Hydarabad')
INSERT INTO tblEmp VALUES('Kiran','Thota','Developer',35000,'Hydarabad')
INSERT INTO tblEmp VALUES('Madhu','Thota','Developer',19000,'Hydarabad')
INSERT INTO tblEmp VALUES('Manasa','Javisetty','Testar',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Malavika','Dongari','Developer',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Mounika','Javisetty','Testar',15000,'Hydarabad')
INSERT INTO tblEmp VALUES('Anji','Dongari','Developer',25000,'Hydarabad')
INSERT INTO tblEmp VALUES('Aravind','Choodi','Developer',32000,'Hydarabad')
INSERT INTO tblEmp VALUES('Avinash','Choodi','Developer',26000,'Hydarabad')

How to restrict textbox values in angularJS

In this article i show you how to get textbox value in angulaJS. First we need to add angularJS reference
in html page
Step1:- add angularJS reference in html page
    <script src="Scripts/angular.js"></script>
    <script src="Scripts/Script1.js"></script>
Script1.js is the javascript file for declaring module and controller

/// <reference path="angular.min.js" />
var app = angular.module("myapp",[])
    .controller("mycontroller", function ($scope)
    {
})
add reference to the javascriptfile
step2:-Add html page.In angularJS we have two directives ng-mimilenth ang ng-maxlenth for restricting textbox values.We are using expressions for getting textbox value.Expressions are declared by using bracess
    <div ng-app="myapp">
        <div ng-controller="mycontroller">
            <input type="text" ng-model="name" ng-maxlength="12" ng-minlength="5"  />
            <br />
            <br />
            {{name}}
        </div>
    </div>

How to get textbox value in angularJS

In this article i show you how to get textbox value in angulaJS. First we need to add angularJS reference
in html page
Step1:- add angularJS reference in html page
    <script src="Scripts/angular.js"></script>
    <script src="Scripts/Script1.js"></script>
Script1.js is the javascript file for declaring module and controller

/// <reference path="angular.min.js" />
var app = angular.module("myapp",[])
    .controller("mycontroller", function ($scope)
    {
})
add reference to the javascriptfile
step2:-Add html page.We are using expressions for getting textbox value.Expressions are declared by using bracess
    <div ng-app="myapp">
        <div ng-controller="mycontroller">
            <input type="text" ng-model="name"  />
            <br />
            <br />
            {{name}}
        </div>
    </div>

How to define array of list items to the dropdownlist in asp.net

     We can define array of list items to the dropdownlist in code behind
   protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                ListItem[] li = new ListItem[4];
                {
                new ListItem("AP","1");
                new ListItem("UP","2");
                new ListItem("MP","3");
                new ListItem("TS","4");
                }
                DropDownList1.Items.AddRange(li);
                //INSERT AN ITEM AS LISTITEM AT ZERO INDEX
                DropDownList1.Items.Insert(0, new ListItem("Select State", "0"));

How to declare dropdownlist different ways in asp.net

In this article i show you how to declare dropdownlist different ways in asp.net
First we can declare in source code
1st way:-
        <asp:DropDownList ID="DropDownList1" runat="server">
            <asp:ListItem Text="Select State" Value="-1"></asp:ListItem>
            <asp:ListItem Text="AP" Value="1"></asp:ListItem>
            <asp:ListItem Text="UP" Value="2"></asp:ListItem>
            <asp:ListItem Text="TS" Value="3"></asp:ListItem>
            <asp:ListItem Text="MP" Value="4"></asp:ListItem>
            <asp:ListItem Text="Tamilnadu" Value="5"></asp:ListItem>          
        </asp:DropDownList>
2nd way:-
        <asp:DropDownList ID="DropDownList1" runat="server">
            <asp:ListItem  Value="-1">Select State</asp:ListItem>
            <asp:ListItem  Value="1">AP</asp:ListItem>
            <asp:ListItem  Value="2">UP</asp:ListItem>
            <asp:ListItem  Value="3">TS</asp:ListItem>
            <asp:ListItem  Value="4">MP</asp:ListItem>
            <asp:ListItem  Value="5">Tamilnadu</asp:ListItem>          
        </asp:DropDownList>

Directives In angularJS

Below are the some important directives
  • ng-app :- Defines the root element of the application
  • ng-bind :-Bind the content of the html element to the application data
  • ng-blur   :-Specifies the behavior on blur event
  • ng-change :-Specifies an expression to evaluate when content is being changed by the user
  • ng-checked:-Specifies the element is checked or not
  • ng-class :-Specifies the CSS class on html element
  • ng-class-event :-Same as ng-class but effect only even rows
  • ng-class-odd :-Same as ng-class but effect only odd rows
  • ng-click :-It work as click event
  • ng-hide :- Hide or Shows html elements
  • ng-if  :-Removes the html elements if condition is false
  • ng-include :-Include the html to the application

Data Providers In ADO.NET

1. Connection Object :- It provides a connection to the database
 2. Command Object :- It is used to execute a command
3. DataReader Object :- It provides a forward-only, read only, connected RecordSet
4. DataAdapter Object :- It populates a disconnected DataSet with data and performs update
These all above ADO.NET Objects consists of following major component class based on their data providers:
1. Sql Data Provider :-

  •  SqlConnection - Connection Object
  •  SqlCommand - Command Object
  •  SqlDataReader - DataReader Object
  •  SqlDataAdapter - DataAdapter Object

ADO.NET Namespaces In Asp.Net

The System.Data namespace is the core namespace of ADO .NET. It consists of the base classes for the ADO.NET architecture. All data providers use these classes. It defines classes that represent table, columns, row, and datasets some common classes from this namespace DataView, DataViewManager DataSet, DataTable, DataRow, DataColumn, and DataRelation. To use these classes in your applications, you need to add a reference to the System.Data namespace.
The System.Data namespaces contain classes for accessing and managing data from diverse sources. The top-level namespace and a number of the child namespaces together form the ADO.NET architecture and ADO.NET data providers. For example, providers are available for SQL Server, Oracle, ODBC, and OleDB. Other child namespaces contain classes used by the ADO.NET Entity Data Model (EDM) and by WCF Data Services.

Crud Operations In SQL Using Storedprocedure

In this article i explain you how to write crud operations in sql using stored procedure we have an senario
to write all operations write in single stored procedure
Example:-
Step1:- Create Table
Create Table Employee
(
Id                  int primary key identity,
Name            varchar(50),
Designation    varchar(50),
Gender         varchar(50),
Salary           int
)
Step2:-Insert some data into table
Insert Into Employee values('Vasu','Developer','Male',25000)
Insert Into Employee values('kiran','Developer','Male',30000)
Insert Into Employee values('madhu','Tester','Female',40000)
Insert Into Employee values('manasa','Tester','Female',50000)

RegistrationForm With Modal Popup In MVC Using BootStrap

In this article i will show you how to design registration form using modal popup in mvc
write the code in your cshtml page
Example:-
Step1:- Take one button
<input type="button" value="Sumbit" id="btn1" />
Sterp2:-Wreite jquery code
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btn1").click(function()
            {
                $("#modalbox").modal("show")
            })
        })

    </script>

How To Declare CheckBox Different Ways In MVC

In this article i explain you how to declare checkbox different ways in mvc
We have diffrent overloaded versions in mvc for declaring checkbox

1st Form :-
    @Html.CheckBox("CheckBox1")
2nd Form :-
    @Html.CheckBox("CheckBox1",true)
3rd Form :-
    @Html.CheckBox("CheckBox1", new { id="chk1",value="option1"})
4rh Form :-
    @Html.CheckBox("CheckBox1", new Dictionary<string, object>() { { "id","chk1"} ,{"value","option"}})
5th Form :-
    @Html.CheckBox("CheckBox1", true, new { id="chk1",value="option1"})
6th Form :-
    @Html.CheckBox("CheckBox1", true, new Dictionary<string, object>() { {"id","chk1" },{"value","option1"} })

How To Declare TextArea Different Ways In MVC

In this article i explain you how to declare TextArea in mvc
1st Form :-TextArea with name
    @Html.TextArea("txtName")
2nd Form :-TextArea name and value
    @Html.TextArea("txtName","value")
3rd Form :-TextArea name,value and styles
    @Html.TextArea("txtName", new { id="txtId",style="background-color:green"})
4th Form :-TextArea using dictionary
    @Html.TextArea("txtAddress", new Dictionary<string, object>() { { "id", "txtAddress" }, { "class","class1"} })
5th Form :-TextArea name,value and id
    @Html.TextArea("txtName", "value", new { id="txtId",@class="class1"})
6th Form :-TextArea name,value , id and style using dictionary
    @Html.TextArea("txtName", "value", new Dictionary<string, object>() {{"id","txtId"},{"style","color:green"}})

How To Declare TextBox Different Ways In MVC

In this article i explain you how to declare textbox different ways in mvc
 1st Way:- textbox with name
         @Html.TextBox("txtName")
2nd Way :-textbox name and value
    @Html.TextBox("txtName","value")
3rd Way:-textbox name,value,id,maxlenth and size
    @Html.TextBox("txtName", "value", new { id="txt1",maxlenth="20",size="15"})
4th Way :-textbox name,value and currency 
    @Html.TextBox("txtName",15000,"{0:C}")

5th Way:-textbox name,value using dictionary 
    @Html.TextBox("txtName","value",new Dictionary<string,object>(){{"id","txt1"},{"maxlenth","15"},    {"size","20"},{"class","class1"}})

How To Declare ListBox Different Ways In MVC

In this article i explain you how to declare ListBox in mvc

    @using(Html.BeginForm())
    {
        List<SelectListItem> objSelectItem = new List<SelectListItem>()
        {
            new SelectListItem(){Text="Option1",Value="1"},
            new SelectListItem(){Text="Option2",Value="2"},
            new SelectListItem(){Text="Option3",Value="3"},
            new SelectListItem(){Text="Option4",Value="4"}
        };
        @Html.ListBox("ListBox1",objSelectItem)
    }

How To Declare ListBox Using ViewData In MVC

In this article i explain you how to declare ListBox Using ViewData in mvc.
    @using(Html.BeginForm())
    {
        List<SelectListItem> objSelectItem = new List<SelectListItem>()
        {
            new SelectListItem{Text="Option1",Value="1"},
            new SelectListItem{Text="Option2",Value="2"},
            new SelectListItem{Text="Option3",Value="3"},
            new SelectListItem{Text="Option4",Value="4"}
        };
        ViewData["ListBox1"] = objSelectItem;
        @Html.ListBox("ListBox1")    
    }

How To Declare DropDownList Different Ways In MVC

In this article i will explain you how to declare dropdownlist different ways
Step1:-
    @using (Html.BeginForm())
    {
        List<SelectListItem> objSelectItem = new List<SelectListItem>()
        {
            new SelectListItem{Text="Option1",Value="1"},
            new SelectListItem{Text="Option2",Value="2"},
            new SelectListItem{Text="Option3",Value="3"},
            new SelectListItem{Text="Option4",Value="4"}
        };
        @Html.DropDownList("DropDownList1",objSelectItem)
    }
2nd Way :-
  @Html.DropDownList("DropDownList1", new List<SelectListItem>()
{
    new SelectListItem{Text="Option1",Value="1"},
    new SelectListItem{Text="Option2",Value="2"},
    new SelectListItem{Text="Option3",Value="3"},
    new SelectListItem{Text="Option4",Value="4"}

})

How To Declare DropDownList Using ViewData In MVC

In this article i will explain you how to declare dropdownlist different ways in mvc
we are declaring dropdownlist  statically
Step1:-Using ViewData
    @using(Html.BeginForm())
    {
        List<SelectListItem> objListItem = new List<SelectListItem>();
        objListItem.Add(new SelectListItem() { Text = "Option1", Value = "opt1" });
        objListItem.Add(new SelectListItem() { Text = "Option2", Value = "otp2" });
        objListItem.Add(new SelectListItem() { Text = "Option3", Value = "opt3" });
        ViewData["DropDownList1"] = objListItem;
        @Html.DropDownList("DropDownList1")
    }
Second Way:-Using ViewData
    @using (Html.BeginForm())
    {
        List<SelectListItem> objSelectItem = new List<SelectListItem>()
        {
            new SelectListItem{Text="Option1",Value="opt1"},
            new SelectListItem{Text="Option2",Value="opt2"},
            new SelectListItem{Text="Option3",Value="opt3"},
            new SelectListItem{Text="Option4",Value="opt4"}
        };
       ViewData["DropDownList1"] = objSelectItem;
        @Html.DropDownList("DropDownList1","Select Option")
    }

Date Methods In Javascript

In this article i explain you javascript date functions
1.getDate()         :-      Get the day as a number
1.getFullYear()    :-     Get the year
2.getMonth()      :-      Get  the month
3.getDay()          :-      Get the week day as a number
4.getHourrs()     :-       Get the hour
5.getMinutes()    :-      Get the minutes
6.getTime()         :-      Get the time
7.getSeconds()   :-      Get the seconds
8.getmilliSeconds():-   Get the milli seconds

How To Resolve SQL Connection In SQL Server

In this article i explain you how to resolve sql connection when we connecting to sql server
Below is the screen

Step1:- Go to SQL Configuration Manager
Select SQL SERVER(MSSQLEXPRESS) right click on that then see if it stop click start

Stil if in case it is not work

Contextual classes In Bootstrap

Use contextual classes to style list items, default or linked. Also includes .active state.
We can define contextual classes in two ways
step1:- using un-orderd list
<ul class="list-group">
  <li class="list-group-item list-group-item-success">List-Group-item-1</li>
  <li class="list-group-item list-group-item-info">List-Group-item-2</li>
  <li class="list-group-item list-group-item-warning">List-Group-item-3</li>
  <li class="list-group-item list-group-item-danger">List-Group-item-4</li>
</ul>

RegistrationForm In ASP.NET Using Bootstrap

In this artcle i explai you how to design registrationform in asp.net using bootstrap and i am going to design
more number of forms this is sample design 1
Make sure you have to download the bootstrap references in www.bootstrap.com after that use script in your source code
Below is the code just copy and past in your source code and see the result
Example:-
              <div class="container-fluid " style="margin-top:50px; margin-bottom:0px">
            <div class="form-horizontal">
                <div class="row">
                    <div class="col-sm-8 col-sm-offset-4 text-primary">
                        <h2>RegistrationForm</h2>
                    </div>
                </div>

HOW TO GET TABLES LIST IN SQL SERVER DATABASE

In this articel i explain you how to get list of tables in sql server database
Below is the query
Gets list of tables 
SELECT*FROM SYSOBJECTS WHERE xtype='U'
     (OR)
SELECT *FROM sys.tables
Gets list of tables and views
SELECT *FROM INFORMATION_SCHEMA.TABLES
Gets list of stored procedure
SELECT*FROM SYSOBJECTS WHERE xtype='P'
Gets list of views
SELECT*FROM SYSOBJECTS WHERE xtype='V'
To get the list different objects types(xtype) from database
SELECT DISTINCT xtype FROM SYSOBJECTS

What is the difference between inline table valued and multi statement valued functions in SQL

In this article i explain you how to declare inline table valued functions and multi-statement valued functions in sql
 In line table valued functions :-
Create Function fnILTVF_GetEmployees()
Returns Table
as
Return (Select Id, Name, Cast(DateOfBirth as Date) as DOB
        From tblEmployees)
Multi-statement Table Valued function :-
Create Function fnMSTVF_GetEmployees()
Returns @Table Table (Id int, Name nvarchar(20), DOB Date)

RegistrationForm With Panel In ASP.NET Using Bootstrap

In this article i explain you how to design registration form using panel in in asp.net
below is the source code
<div class="row" style="margin-left:100px;margin-top:50px">
            <div class="col-sm-6 col-md-6 col-xs-12 col-lg-6">
                <div class="panel  panel-primary">
                    <div class="panel-heading" data-toggle="collapse" data-target="#panelHeader">
                        <div class="row">
                            <div class="col-sm-12 col-md-12 col-xs-12">
                                <h2>Personal Details</h2>
                            </div>

ChangePasswordForm In ASP.NET Using Bootstrap

In this article i explain you how to design change password from in asp.net using bootstrap
Example:-
<div class="container">
            <div class="form-horizontal" style="border:1px solid black;width:600px;height:350px;padding:10px;margin-left:50px;margin-top:50px">
                <div class="row">
                    <div class="col-sm-9 col-sm-offset-3 text-primary">
                        <h2>Change Password</h2>
                    </div>
                </div>

Password Recovery Form In ASP.NET Using Bootstrap

Simple Password Recovery Form In ASP.NET
Below is the source code
Example:-
<div class="container">
            <div class="form-horizontal" style="border:1px solid black;width:600px;height:250px;padding:10px;margin-left:50px;margin-top:50px">
                <div class="row">
                    <div class="col-sm-9 col-sm-offset-3 text-primary">
                        <h2>Password Recovery</h2>
                    </div>
                </div>

LoginForm In ASP.NET Using Bootstrap

Below is the simple login form in asp.net using bootstrap
Example:- Here is the source code
        <div class="container">
            <div class="form-horizontal" style="border:1px solid black;width:600px;height:250px;padding:10px;margin-left:50px;margin-top:50px">
                <div class="row">
                    <div class="col-sm-3 col-sm-offset-3 text-primary">
                        <h2>Login</h2>
                    </div>

How To Get TextBox Value Using Button Click In Jquery

In this article i explain you how to get textbox value in jquery
Add jquery refereces to your code
Step1:-
 <script type="text/javascript">
        $(document).ready(function () {  

Datepicker In Jquery

In this article i explain you how to use datepicker
Below are some of the datepicker options and methos listed
Options:-                                             Methos:-
maxDate                                              destroy

minDate                                               dialog
dateFormat                                          getDate
buttonImage                                         hide
buttonImageOnly                                 isDisabled
buttonText               

Jquery Accordion Customization Example

In this article i explain you how to customize the jquery accordion
Download the jquery scripts in jquery.com
use jquery ui-widge in your code

Dont get confuse it is very simple believe me just it looking lenthy thats not a matter copy the step3 code and paste in your source code
STEP 1:- Write script code
 <script type="text/javascript">

SMTP E-MAIL Class Properties In ASP.NET

ClientCertificates :-
Specify which certificates should be used to establish the Secure Sockets Layer (SSL) connection.
Credentials :-
Gets or sets the credentials used to authenticate the sender.

DetailsView Templates In ASP.NET

AlternatingItemTemplate :-
Specifies the content to display for the alternating items in a TemplateField object.
EditItemTemplate :-
Specifies the content to display for an item in edit mode in a TemplateField object.
FooterTemplate :-
Specifies the content to display for the footer section of a TemplateField object.
HeaderTemplate :-

Events of the DetailsView Control In ASP.NET

ItemCommand :-
Occurs when a button within a DetailsView control is clicked.
ItemCreated :-
Occurs when a record is created in a DetailsView control.

DetailsView Style Properties In ASP.NET

AlternatingRowStyle :-
Defines the style properties for every alternate row in the DetailsView.
EditRowStyle :-
Defines the style properties for the row in EditView (When you click Edit button for a row, the row will appear in this style).

DetailsView Proprties In ASP.NET

AllowPaging :-
true/false. Indicate whether the control should support navigation.
DataSource :-
Gets or sets the data source object that contains the data to populate the control.

ListView Control Properties In ASP.NET

DataKeyNames:-
Gets or sets an array that contains the names of the primary key fields for the items displayed in a ListView control.
DataKeys:-
Gets a collection of DataKey objects that represent the data-key value for each item in a ListView control.

Events of ListView Control In ASP.NET

1.ItemCanceling:-
 Occurs when a cancel operation is requested, but before the ListView control cancels the insert or edit  operation.
2.ItemCommand:-
  Occurs when a button in a ListView control is clicked.

ListView Control Templates In ASP.NET

Templates control certain aspects of the ListView control's generated HTML. Templates are required with ListView; they are optional with other data controls. These templates provide complete control over the
output; that is, all aspects of the ListView's generated markup are controlled via templates.

What are the advantages of caching and types in ASP.NET

One of the most important factors in building high-performance, scalable Web applications is the ability to store items, whether data objects, pages, or parts of a page, in memory the initial time they are requested. You can cache, or store, these items on the Web server or other software in the request stream, such as the proxy server or browser. This allows you to avoid recreating information that satisfied a previous request, particularly information that demands significant processor time or other resources. ASP.NET caching allows you to use a number of techniques to store page output or application data across HTTP requests and reuse it.

Transactions in SQL Server

What is a Transaction?

A transaction is a group of commands that change the data stored in a database. A transaction, is treated as a single unit. A transaction ensures that, either all of the commands succeed, or none of them. If one of the commands in the transaction fails, all of the commands fail, and any data that was modified in the database is rolled back. In this way, transactions maintain the integrity of data in a database.

What is caching in ASP.NET MVC and when to use it?

Caching is a most important aspect of high-performance web application. Caching provides a way of storing frequently accessed data and reusing that data. Practically, this is an effective way for improving web application’s performance.

What are advantages of caching in ASP.NET MVC?

These are following advantages of caching:-
1. Reduce hosting server round-trips
2. When content is cached at the client or in proxies, it cause minimum request to server.
3. Reduce database server round-trips
4. When content is cached at the web server, it can eliminate the database request.
5. Reduce network traffic
6. When content is cached at the client side, it also reduce the network traffic.
7. Avoid time-consumption for regenerating reusable content

What is the order of execution of filters in ASP.NET MVC?

All ASP.NET MVC filter are executed in an order. The correct order of execution is given below:

1.Authentication filters
2. Authorization filters
3. Action filters
4. Result filters

What are ASP.NET MVC Filters and Attributes?

Ans. ASP.NET MVC provides a simple way to inject your piece of code or logic either before or after an action is executed. This is achieved by decorating the controllers or actions with ASP.NET MVC attributes or custom attributes. An attribute or custom attribute implements the ASP.NET MVC filters (filter interface) and can contain your piece of code or logic. You can make your own custom filters or attributes either by implementing ASP.NET MVC filter interface or by inheriting and overriding methods of ASP.NET MVC filter attribute class if available.

What is Scaffolding In Asp.Net MVC ?

Scaffolding is a technique used by many MVC frameworks like ASP.NET MVC, Ruby on Rails, Cake PHP and Node.JS etc., to generate code for basic CRUD (create, read, update, and delete) operations against your database effectively. Further you can edit or customize this auto generated code according to your need.

Data Annotations in ASP.NET MVC

Data validation is a key aspect for developing web application. In Asp.net MVC, we can easily apply validation to web application by using Data Annotation attribute classes to model class. Data Annotation attribute classes are present in System.ComponentModel.DataAnnotations namespace and are available to Asp.net projects like Asp.net web application & website, Asp.net MVC, Web forms and also to Entity framework ORM models.

Action Methods In MVC

Controller actions are methods defined in the controller class and responsible to perform required operations on the user's inputs like as form values, query strings values etc. with the help of Model and passing the results back to the View. Asp.net MVC has the following built-in ActionResults Type and Helper methods:

Brief History Of ASP.NET MVC

Ans. Here is the list of released version history of ASP.NET MVC Framework with theirs features.

ASP.NET MVC1:-

1. Released on Mar 13, 2009
2. Runs on .NET 3.5 and with Visual Studio 2008 & Visual Studio 2008 SP1
3. MVC Pattern architecture with WebForm Engine
4. Html Helpers
5. Ajax helpers
6. Routing
7. Unit Testing

Accordion Control In Ajax

The Accordion is a web control that allows you to provide multiple panes and display them one at a time. It is like having several CollapsiblePanels where only one can be expanded at a time. The Accordion is implemented as a web control that contains AccordionPane web controls. Each AccordionPane control has a template for its Header and its Content. We keep track of the selected pane so it stays visible across postbacks.
The Accordion control supports the following AutoSize modes to accommodate a variety of page layouts.
1. None: - The Accordion control grows and shrinks without restriction. This can cause other elements on the page to move up and down in order to accommodate the Accordion control.
2. Limit: - The Accordion control never grows larger than the value specified by its Height property. This causes the content to scroll if the content is too long to be displayed in the allotted space.
3. Fill: - The Accordion control is a fixed size as specified in its Height property. This causes the content to be expanded or shrunk if the content does not fit exactly into the allotted space.

ConfirmButtonExtender Control In Ajax

ConfirmButtonExtender is a simple extender that catches clicks on a button (or any instance of a type derived from Button) and displays a message to the user. If the "OK" button is clicked, the button or link functions normally. If not, the click is trapped and the button will not perform its default submit behaviour; optionally, a client script is executed if the OnClientCancel property is set. This is useful for delete links or anything else that requires confirmation from the user.
ConfirmButtonExtender Properties:-
1.TargetControlID: - The ID of the Button control to extend.
2. ConfirmText :- The confirmation text to display.
3. OnClientCancel: - The client script to execute when the Cancel button is clicked in the confirm dialog box.
4. ConfirmOnFormSubmit :- true if the confirm dialog box should not be displayed until just before the form is submitted. This is useful if the page contains ASP.NET validator controls and the confirm dialog box should be displayed only after all validation checks pass.

ModalPopupExtender Control In Ajax

The ModalPopupExtender allows a page to display content to the user in a "modal" manner which prevents the user from interacting with the rest of the page. The modal content can be any hierarchy of controls and is displayed above a background that can have a custom style applied to it.
You can provide OnShowing/OnShown/OnHiding/OnHidden animations which are played when the modal content is shown and hidden. For example, you can use these animations to fade-in and fade-out modal content.

CollapsiblePanelExtender Control In Ajax

The CollapsiblePanelExtender adds collapsible sections to a Web page. This extender targets any ASP.NET Panel control. You specify which control or controls on the page should act as the open and close controllers for the panel. Alternatively the panel can be set to automatically expand and collapse when the mouse cursor moves in or out of it.
The panel is postback aware. During a client postback, the panel remembers and restores its client state.
You can specify whether the panel should scroll when the content is larger than the panel, and whether the panel expands horizontally or vertically (height or width).
CollapsiblePanelExtender Properties:-
 1. TargetControlID :- The ID of the control to expand and collapse.
2. CollapsedSize :- The size of the target, in pixels, when it is in the collapsed state.
3. ExpandedSize :- The size of the target, in pixels, when it is in the opened state.

CalendarExtender Control In Ajax

The Calendar control enables you to display a date picker when focus is moved to an input element.
Calendar is an ASP.NET AJAX extender that can be attached to any ASP.NET TextBox control. It provides client-side date-picking functionality with customizable date format and UI in a popup control. You can interact with the calendar by clicking on a day to set the date, or the "Today" link to set the current date.
CalendarExtender Properties:
1. TargetControlID :- The ID of the TextBox to extend with the calendar.
2. CssClass :- Name of the CSS class used to style the calendar. See the Calendar Theming section for more information.
3. Format :- Format string used to display the selected date.
4. PopupButtonID :- The ID of a control to show the calendar popup when clicked. If this value is not set, the calendar will pop up when the textbox receives focus.

DropShadowExtender Control In Ajax

DropShadow is an extender that applies a drop shadow to an ASP.NET Panel control. The extender allows you to specify how wide the shadow is, how opaque it is, and whether the shadow should have rounded corners. For pages that let the user move or resize the panel, the DropShadow extender has a mode that will resize and reposition the shadow to match the target panel at run time.
DropShadowExtender Properties:-
1. TargetControlID :- The ID of the control to extend.
2. Width: - The width, in pixels, of the drop shadow. The default is 5.
3. Opacity :- The opacity of the drop shadow, from 0 (fully transparent) to 1.0 (fully opaque). The default is    .5.
4. TrackPosition :- A Boolean value that specifies whether the DropShadow should track the position of the panel it is attached to. Set this property to true if the panel is absolutely positioned or if it might move at run time. The default is false.
5. Rounded: - A Boolean value that specifies whether the corners of the target and drop shadow should be rounded.

BalloonPopupExtender Control In Ajax

The BalloonPopupExtender control displays a popup which can contain any content. For example, you can use the BalloonPopupExtender to display help information when you move focus to a TextBox control.
The BalloonPopupExtender supports three different styles: Balloon, Rectangle, and Custom. You can select among three different sizes for the popup: Small, Medium, and Large. If you set the BalloonPopup style to the value Custom then you can define a custom appearance for the BalloonPopup. In that case, you also need to set the CustomCssUrl property to point to a custom style sheet.
This control can be set to 5 positions - TopLeft, TopRight, BottomLeft, BottomRight and Auto. If you select the value Auto then the position of the BalloonPopup is determined automatically based on available space.
You can set the BalloonPopExtender to be triggered by the MouseOver, Focus or Click events. The control is hidden automatically when you click outside the Balloon Popup.

PopupControlExtender Control In Ajax

Example:
<form id="form1" runat="server">
 <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
 <h3> Using PopupControlExtender</h3>
 <hr />
 <div>
 <b>Enter Your Favourite Language: </b>
 <asp:TextBox ID="txtLanguage" runat="server"></asp:TextBox>
 <asp:Panel ID="Panel1" runat="server">
 <div style="border: 1px outset white; width: 150px">
 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
 <ContentTemplate>

PopupControlExtender Control In Ajax

PopupControl is an ASP.NET AJAX extender that can be attached to any control in order to open a popup window that displays additional content. This popup window will probably be interactive and will probably be within an ASP.NET AJAX UpdatePanel, so it will be able to perform complex server-based processing (including postbacks) without affecting the rest of the page. The popup window can contain any content, including ASP.NET server controls, HTML elements, etc. Once the work of the popup window is done, a simple server-side call dismisses it and triggers any relevant script on the client to run and update the page dynamically.

ToggleButtonExtender Control In Ajax

ToggleButton is an ASP.NET AJAX extender that can be attached to an ASP.NET CheckBox control. ToggleButton enables the use of custom images to show the state of the CheckBox. The behaviour of the CheckBox is unaffected.
ToggleButton Properties:
1. TargetControlID: - The ID of the CheckBox to modify
2. ImageHeight\ImageWidth :- The height and width of the image
3. CheckedImageUrl :- the URL of the image to show when the toggle button is in the checked state.
4. UncheckedImageUrl: - the URL of the image to show when the toggle button is in the unchecked state.
5. DisabledCheckedImageUrl :- the URL of the image to show when the toggle button is disabled and in  the checked state.
6. DisabledUncheckedImageUrl: - the URL of the image to show when the toggle button is disabled and in the unchecked state.

ResizableControlExtender Control In Ajax

ResizableControlExtender is an extender that attaches to any element on a web page and allows the user to resize that control with a handle that attaches to lower-right corner of the control. The resize handle lets the user resize the element as if it were a window. The appearance of the resize handle can be specified by the page designer with a CSS style. The content within the element can use CSS styles to automatically resize to fit the new dimensions. Alternatively, ResizableControlExtender exposes two events (onresizing and onresize) that the page designer can attach custom script to in order to enable more complex layout logic.
ResizableControlExtender Properties:-

1. TargetControlID: - The ID of the element that becomes resizable
2. HandleCssClass: - The name of the CSS class to apply to the resize handle
3. ResizableCssClass :- The name of the CSS class to apply to the element when resizing

RoundedCornersExtender Control In Ajax

The RoundedCorners extender applies rounded corners to existing elements. To accomplish this, it inserts elements before and after the element that is selected, so the overall height of the element will change slightly. You can choose which corners of the target panel should be rounded by setting the Corners property on the extender to None, TopLeft, TopRight, BottomRight, BottomLeft, Top, Right, Bottom, Left, or All.
RoundedCornersExtender Properties:-
1.TargetControlID :- The ID of the control to extend.
2. Radius: - The radius of the corners (and height of the added area). The default is 5.
3. Corners :- The corners of the target panel that should be rounded (None, TopLeft, TopRight, BottomRight, BottomLeft, Top, Right, Bottom, Left, or All)
4. BorderColor: - Gets or sets a string that contains the color of the border and therefore of the rounded corners.

TextBoxWatermarkExtender Control In Ajax

TextBoxWatermark is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control to get "watermark" behaviour. When a watermarked TextBox is empty, it displays a message to the user with a custom CSS style. Once the user has typed some text into the TextBox, the watermarked appearance goes away. The typical purpose of a watermark is to provide more information to the user about the TextBox itself without cluttering up the rest of the page.
TextBoxWatermarkExtender Properties:-
1.TargetControlID :- The ID of the TextBox to operate on
2.WatermarkText: - The text to show when the control has no value
3.WatermarkCssClass :- The CSS class to apply to the TextBox when it has no value .

ValidatorCalloutExtender Animations In Ajax

Generic animations for the ValidatorCallout extender:-
OnShow -
The OnShow animation will be played each time the validation popup is displayed. The popup will be positioned correctly but hidden. The animation can use <HideAction Visible="true" /> to display the popup along with any other visual effects.
OnHide -
The OnHide animation will be played each time the validation popup is hidden.
Ex:-
<asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="Server" TargetControlID="RequiredFieldValidator1">
 <Animations>
<OnShow>
 <Sequence>
 <HideAction Visible="true" />
 <FadeIn Duration="1" MinimumOpacity="0" MaximumOpacity="1" />
 </Sequence>
 </OnShow>

ValidatorCalloutExtender In Ajax

ValidatorCalloutExtender:
ValidatorCalloutExtender is an ASP.NET AJAX extender that enhances the functionality of existing ASP.NET validators. To use this control, add an input field and a validator control as you normally would. Then add the ValidatorCalloutExtender and set its TargetControlID property to reference the validator control.
ValidatorCalloutExtender Properties:-
1. TargetControlID :- The ID of the Validator to extend
2. Width :- The width of the callout
3. CssClass :- Name of the CSS class used to style the ValidatorCallout.
4. HighlightCssClass: - A CssClass to apply to the invalid field
5. WarningIconImageUrl :- The path to a custom warning icon image

Gridview control features, properties,events and style properties in asp.net

The GridView control is a powerful data grid control that allows you to display an entire collection of data, add sorting and paging, and perform inline editing. In addition to just displaying data, the GridView can be used to edit, select and delete the displayed data as well.

ImageMap Control In Asp.net

ImageMap Control:

The ASP.NET ImageMap control allows you to create an image that has individual regions that users can click, which are called hot spots. Each of these hot spots can be a separate hyperlink or postback event.

ValidationSummary Control In Asp.net

In this article i explain you how to use validation summary control in registration form
Properties of validation summary control:
HeaderText - The header text for the validation summary control
ShowSummary - Whether to display the summary text of all the validation errors
ShowMessageBox - Whether to display a message box with all the validation errors
DisplayMode - Display format for the summary.
DisplayMode can be List, BulletList, SingleParagraph 

RegistrationForm using validation controls in asp.net

In this article i explain you how to use validation controls in registration form
    <form id="form1" runat="server">
        <div style="margin-top:50px;border:1px solid black;width:500px;padding:10px;margin-left:50px;">
            <table>
                <tr>
                    <td>First Name</td>
                    <td>
                        <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RfvFirstName" runat="server" ControlToValidate="txtFirstName" ForeColor="Red" ErrorMessage="Enter FirstName" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>
                    </td>

OPTIONAL PARAMETERS IN SQL USING STORED STORED PROCEDURE

In this article i am going to tell you how to create stored procedure with optional parameters

STEP 1: - CREATER TABLE

CREATE TABLE tblEmployees
(
Id  int primary key identity,
EmpName   varchar(50),
Gender    varchar(50),
Salary    int
)

HOW TO CREATE STORED PROCEDURE IN SQL SERVER

STEP 1:-  CREATE TABLE

CREATE TABLE tblEmployees
(
Id  int primary key,
EmpName   varchar(50),
Gender    varchar(50),
Salary    int
)

HOW TO CREATE TABLE IN SQL SERVER

STEP 1:- CREATE TABLE

CREATE TABLE tblEmployees
(
Id  int primary key,
EmpName   varchar(50),
Gender    varchar(50),
Salary    int
)

How To Get Text and Value Of DropdownList Using ButtonClick

In this article i will explain how to get selected value and text of dropdownlist 
<!DOCTYPE html>
 <form id="form1" runat="server">
    <div>
        <asp:DropDownList ID="DropDownList1" runat="server">
            <asp:ListItem Text="Select Course" Value="-1"></asp:ListItem>