本文介绍了如何从另一个页面获取一个页面的选定下拉框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

page1.aspx




<asp:DropDownList ID="reporttype" runat="server" Width="57px" OnSelectedIndexChanged="reporttype_SelectedIndexChanged"

                                AutoPostBack="True">
                                <asp:ListItem Value="0">No</asp:ListItem>
                                <asp:ListItem Value="1">Yes</asp:ListItem>
                          </asp:DropDownList></td>
double TotAmount = 0;
            while (rd2.Read())
            {
                if (i < count)
                {
                    items[i] = new InvoiceDetails.InvoiceItems();
                    items[i].Description = AddNewLineChar(rd2[0].ToString(), 36);
                    items[i].Unit = rd2[1].ToString();
                    items[i].Quantity = rd2[2].ToString();
                    items[i].PrevProg = double.Parse(rd2[3].ToString()).ToString("0.00");
                    items[i].CurrProg = double.Parse(rd2[4].ToString()).ToString("0.00");
                    items[i].Rate = rd2[5].ToString();
                    items[i].Amount = double.Parse(rd2[6].ToString()).ToString("0.00");
                    
                    if(Request.QueryString["reporttype_value"] =0)
                    {
                        TotAmount += double.Parse(rd2[6].ToString());
                    }
                    else
                    {
                        TotAmount += (double.Parse(rd2[4].ToString()) - double.Parse(rd2[3].ToString())) * double.Parse(rd2[6].ToString());
                    }
                    i++;
if(Request.QueryString["reporttype_value"] =0) I need to get value here.
 Please let me know where I struck

推荐答案

Protected Sub Index_Changed(sender As Object, e As EventArgs) Handles your_drop_down_list.SelectedIndexChanged
      Response.Redirect(string.Format("your_second_page.aspx?reporttype_value={0}", your_drop_down_list.SelectedValue), true)
   End Sub


这篇关于如何从另一个页面获取一个页面的选定下拉框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 17:51