MyException - 我的异常网
当前位置:我的异常网» ASP.NET » 困扰很久的下拉列表框有关问题

困扰很久的下拉列表框有关问题

www.myexceptions.net  网友分享于:2013-12-18  浏览:317次
困扰很久的下拉列表框问题
HTML代码:
<asp:datagrid   id= "DataGrid1 "   runat= "server "   Width= "100% "   BorderWidth= "1px "   BorderColor= "LightBlue "
AutoGenerateColumns= "False "   AllowPaging= "True "   GridLines= "Horizontal ">
<SelectedItemStyle   Wrap= "False "> </SelectedItemStyle>
<EditItemStyle   Wrap= "False "> </EditItemStyle>
<AlternatingItemStyle   Wrap= "False "   BackColor= "#EBEBEB "> </AlternatingItemStyle>
<ItemStyle   Wrap= "False "> </ItemStyle>
<Columns>
<asp:BoundColumn   DataField= "ID "   HeaderText= "ID ">
<HeaderStyle   Width= "80px "> </HeaderStyle>
</asp:BoundColumn>
<asp:TemplateColumn   HeaderText= "操作 ">
<ItemTemplate>
<FONT   face= "宋体 ">
<asp:DropDownList   id= "DropDownList1 "   runat= "server "   OnSelectedIndexChanged= "DropDownList1_SelectedIndexChanged "
AutoPostBack= "True ">
<asp:ListItem   Value= "操作 "> 操作 </asp:ListItem>
<asp:ListItem   Value= "0 "> 详细信息 </asp:ListItem>
<asp:ListItem   Value= "1 "> 销售报告 </asp:ListItem>
<asp:ListItem   Value= "2 "> 合同信息 </asp:ListItem>
<asp:ListItem   Value= "3 "> 填写销售报告 </asp:ListItem>
</asp:DropDownList> </FONT>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>

</asp:datagrid>
事件代码:
Sub   DropDownList1_SelectedIndexChanged(ByVal   sender   As   Object,   ByVal   e   As   System.EventArgs)
                Dim   dg   As   DataGridItem
                For   Each   dg   In   DataGrid1.Items
                        Dim   mydd   As   DropDownList   =   dg.FindControl( "DropDownList1 ")
                        Select   Case   mydd.SelectedValue
                                Case   0
                                      Response.Redirect( "inf.aspx?id= "   +   ID)
                                Case   1
                                      Response.Redirect( "inf1.aspx?id= "   +   ID)                  
                                Case   2
                                        Response.Redirect( "inf2.aspx?id= "   +   ID)

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有