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)
    }