如何编写dropdownlist所选索引的代码已更改 [英] how to write the code for dropdownlist selected index changed
本文介绍了如何编写dropdownlist所选索引的代码已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的源代码如下
< asp:GridView ID = gvfaculty runat = server AutoGenerateColumns = False
BackColor = < span class =code-string> LightGoldenrodYellow BorderColor = Tan BorderWidth = 1px
CellPadding = 2 ForeColor = 黑色 GridLines = 无高度= 107px
onrowcreated = gvfaculty_RowCreated onrowdatabound = gvfaculty_RowDataBound
onselectedindexchanged = gvfaculty_SelectedIndexChanged Width = 91px >
< asp:BoundField DataField = 教职员名称 HeaderText = 教职员名称 />
< asp:BoundField DataField = FacultyID HeaderText = FacultyID />
< asp:TemplateField HeaderText = 1 >
< itemtemplate>
< asp:DropDownList ID = DropDownList1 runat = server AppendDataBoundItems = true >
< asp:ListItem Value = - 1> - 选择评分 -
< / itemtemplate >
< asp:TemplateField HeaderText = 2 >
< itemtemplate>
< asp:DropDownList ID = DropDownList2 runat = server AppendDataBoundItems = true >
< asp:ListItem Value = - 1> - 选择评分 -
< / itemtemplate >
< asp:TemplateField HeaderText = 3 >
< itemtemplate>
< asp:DropDownList ID = DropDownList3 runat = server AppendDataBoundItems = true >
< asp:ListItem Value = - 1> - 选择评分 -
< / itemtemplate >
以上三个下拉列表如何为dropdownlist选择索引更改事件编写代码。
为什么我在asp.net中使用c#。
解试点
试试这个:
http://stackoverflow.com/questions/20852619/how-to-get-selected-value-from-dropdownlist-which-is-inside-gridview [ ^
My source code as follows
<asp:GridView ID="gvfaculty" runat="server" AutoGenerateColumns="False"
BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
CellPadding="2" ForeColor="Black" GridLines="None" Height="107px"
onrowcreated="gvfaculty_RowCreated" onrowdatabound="gvfaculty_RowDataBound"
onselectedindexchanged="gvfaculty_SelectedIndexChanged" Width="91px">
<asp:BoundField DataField="Faculty Name" HeaderText="Faculty Name" />
<asp:BoundField DataField="FacultyID" HeaderText="FacultyID" />
<asp:TemplateField HeaderText="1">
<itemtemplate>
<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="true">
<asp:ListItem Value="-1">--Select Grading --
</itemtemplate>
<asp:TemplateField HeaderText="2">
<itemtemplate>
<asp:DropDownList ID="DropDownList2" runat="server" AppendDataBoundItems="true">
<asp:ListItem Value="-1">--Select Grading --
</itemtemplate>
<asp:TemplateField HeaderText="3">
<itemtemplate>
<asp:DropDownList ID="DropDownList3" runat="server" AppendDataBoundItems="true">
<asp:ListItem Value="-1">--Select Grading --
</itemtemplate>
for the above three dropdownlist how to write code for dropdownlist selected index changed event.
for that how can i do in asp.net using c#.
解决方案
Try this:
http://stackoverflow.com/questions/20852619/how-to-get-selected-value-from-dropdownlist-which-is-inside-gridview[^]
这篇关于如何编写dropdownlist所选索引的代码已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文