ASP.NET SelectedIndex প্রতিভূতি
সংজ্ঞা ও ব্যবহার
SelectedIndex প্রতিভূতি ডাউনলিস্টের নির্বাচিত প্রক্রিয়ার ইনডেক্স অর্জন করা ও সংযোজন করা হয়
প্রয়োগ
নিচের উদাহরণটি নির্বাচিত প্রক্রিয়ার টেক্সট প্রদর্শন করে:
<script runat="Server"> Sub GetName(obj As Object, e As EventArgs) lbl.Text = ddList.SelectedItem.Text End Sub </script> <form runat="Server"> তালিকা থেকে একটি নাম নির্বাচন করুন: <asp:DropDownList id="ddList" runat="Server"> <asp:ListItem Text="Peter" /> <asp:ListItem Text="Lois" /> <asp:ListItem Text="Cleveland" /> <asp:ListItem Text="Quagmire" /> <asp:ListItem Text="Joe" /> </asp:DropDownList> <asp:Button Text="Select" OnClick="GetName" Runat="Server" /> <br /> নাম হল: <asp:Label id="lbl" Runat="Server"/> </form>
প্রয়োগ
- DropDownList-এর একটি প্রক্রিয়া থেকে টেক্সট পাওয়া