இந்த வீடியோவில்
டிராப்டவுன் கன்ட்ரோல் பற்றி காண இருக்கின்றோம்.
Source code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm9.aspx.cs" Inherits="textboxdemo.WebForm9" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
</html>
Script
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace textboxdemo
{
public partial class WebForm9 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ListItem maleitem = new ListItem("Male", "1");
ListItem femaleitem = new ListItem("Female", "2");
DropDownList1.Items.Add(maleitem);
DropDownList1.Items.Add(femaleitem);
}
}
}
}
to learn Dotnet course in Madurai area contact:9629329142.
No comments:
Post a Comment