Skip to main content

Implementation Of DropDownList

 1. Implementation Of DropDownList-  

(i)Design-


(ii)Code-

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;


public partial class Assign1 : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {


    }

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)

    {

        if (DropDownList1.Text == "UG")

        {

            DropDownList2.Items.Clear();

            DropDownList2.Items.Add("CSE");

            DropDownList2.Items.Add("IT");

            DropDownList2.Items.Add("CIVIL");

            DropDownList2.Items.Add("MECH");

            DropDownList2.Items.Add("ETC");

            DropDownList2.Items.Add("ETRX"); 

        }


        if (DropDownList1.Text == "PG")

        {

            DropDownList2.Items.Clear();

            DropDownList2.Items.Add("MCA");

            DropDownList2.Items.Add("MBA");

            DropDownList2.Items.Add("MTECH");

        }


        

    }

    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)

    {

        if (DropDownList2.Text == "CSE")

            Label1.Text = "70%";

        else if (DropDownList2.Text == "IT")

            Label1.Text = "60%";

        else if (DropDownList2.Text == "CIVIL")

            Label1.Text = "50%";

        else if (DropDownList2.Text == "MECH")

            Label1.Text = "55%";

        else if (DropDownList2.Text == "ETC")

            Label1.Text = "65%";

        else if (DropDownList2.Text == "ETRX")

            Label1.Text = "70%";

        else if (DropDownList2.Text == "MCA")

            Label1.Text = "60%";

        else if (DropDownList2.Text == "MBA")

            Label1.Text = "65%";

        else if (DropDownList2.Text == "MTECH")

            Label1.Text = "70%";

    }

}



    


Comments

Popular posts from this blog

FileUpload And QueryString

1. Took File Upload control, Button, Image button control,  Label (First Page) [Browse your desired file > Click on Upload Button > Image will be shown in Image Button Control  ]  Inside the event of ImageButton QueryString is defined.  CODING- 2. When we click on it then the next page will be shown Image ,Using QueryString-  (Next Page) Image control will be used-  Inside page_load event we will call QueryString.

Quiz[Session]

  3.USING SESSION-   Code- using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Assign2 : System.Web.UI.Page {     protected void Page_Load(object sender, EventArgs e)     {     }     protected void Button11_Click(object sender,EventArgs e)     {         if (RadioButtonList1.SelectedIndex == 0)              TextBox1.Text = "1";         else              TextBox1.Text = "0";                               if (RadioButtonList2.SelectedIndex == 2)             TextBox2.Text = "1";         else             TextBox2.Text = "0";           ...

QueryString_Assignment

    Write a code for this-                                                                    1.Registration.aspx- Coding of SUBMIT button- using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Registration : System.Web.UI.Page {     protected void Page_Load(object sender, EventArgs e)     {     }     protected void Button1_Click(object sender, EventArgs e)     {         Response.Redirect("Login.aspx?name=" +TextBox1.Text + "&email=" + TextBox2.Text + "&mobile=" +TextBox3.Text + "&pass=" +TextBox4.Text + "&city=" + DropDownList1.Text);      } } 2. Login.aspx- Coding of LOGIN button- using System; using System.Collections.Generic; using System.Linq; using...