Add Items or Value to DropDownList in Asp.Net Using Jquery & C#

Add Items or Value to DropDownList 

Add Textbox Text  Items or Value to Dropdownlist  in Jquery & C# Coding in Dynamically  Using Asp.Net C#.



                            HTML Coding

<html xmlns="">
<head runat="server">
    <title>Add items to dropdownlist in using jquery</title>

    <script src="jquery.min.js"></script>
        $(document).ready(function () {
            $('#btn_add').click(function () {
    <form id="form1" runat="server">
    <div align="center">
    <asp:TextBox ID="txtCourse" runat="server"></asp:TextBox>
        <br />
        <asp:Button ID="btn_add" runat="server" Text="Add Item Jquery"  />
<asp:Button ID="Button1" runat="server" Text="Add Item C#" OnClick="Button1_Click" />
        <br />
<asp:DropDownList ID="ddlCourse" runat="server">
        <asp:ListItem Text="Select Course"></asp:ListItem>

                                   C# Coding

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default2 : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)

    protected void Button1_Click(object sender, EventArgs e)


Add New Web Form - Select Textbox,Dropdownlist Form Toolbox

Next - Add to Jquery Plugin & Append Textbox Text to Dropdownlist

Next - Add To C# Coding in Button Onclick Mode


Post a Comment