Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何将下拉列表的值从.aspx传递到.asmx.cs?_Asp.net_Asmx - Fatal编程技术网

Asp.net 如何将下拉列表的值从.aspx传递到.asmx.cs?

Asp.net 如何将下拉列表的值从.aspx传递到.asmx.cs?,asp.net,asmx,Asp.net,Asmx,我的p1.aspx上有一个下拉列表: <select id="ListBoxViewType" style="width:160px;font-family:Tahoma;visibility:hidden;"> <option value="Amendment">Amendment</option> <option value="Agreement">

我的p1.aspx上有一个下拉列表:

<select id="ListBoxViewType" style="width:160px;font-family:Tahoma;visibility:hidden;">
                        <option value="Amendment">Amendment</option>
                        <option value="Agreement">Full Terms Amendment</option>
                        <option value="Both">Both</option>
                    </select>

修正案
完整条款修订
二者都
我需要得到p2.asmx.cs上的值:

if ( <insert something like this: ListBoxViewType.Value=="Amendment">)
                            {
                                fileName = chReadData.ContractNumber +"_Amendment" +"-" + chReadData.DisplaySupplementNumber;
                                description = "Amendment for " + chReadData.ContractNumber + "-" + chReadData.DisplaySupplementNumber + " (\"" + chReadData.ContractDescription + "\")";
                            }
                            else 
                            {
                                fileName = chReadData.ContractNumber +"_Full_Amendment" +"-" + chReadData.DisplaySupplementNumber;
                                description = "Amendment for " + chReadData.ContractNumber + "-" + chReadData.DisplaySupplementNumber + " (\"" + chReadData.ContractDescription + "\")";
                            }
if()
{
fileName=chReadData.ContractNumber+“_-Amendment”+“-”+chReadData.DisplayAddmentNumber;
description=“对“+chReadData.ContractNumber+”—“+chReadData.DisplaySupplementNumber+”(\“”+chReadData.ContractDescription+“\”)的修改”;
}
其他的
{
fileName=chReadData.ContractNumber+“\u Full\u modification”+“-”+chReadData.DisplaySupplementNumber;
description=“对“+chReadData.ContractNumber+”—“+chReadData.DisplaySupplementNumber+”(\“”+chReadData.ContractDescription+“\”)的修改”;
}
只需将
runat=“server”
添加到所选元素:

<select id="ListBoxViewType" runat="server" style="width:160px;font-family:Tahoma;visibility:hidden;">
                    <option value="Amendment">Amendment</option>
                    <option value="Agreement">Full Terms Amendment</option>
                    <option value="Both">Both</option>
                </select>

另外,您应该考虑使用<代码> DROPPDROUNDUCT控件来代替:

<asp:DropDownList ID="ListBoxViewType" runat="server"....
<asp:DropDownList ID="ListBoxViewType" runat="server"....
this.ListBoxViewType.SelectedValue
this.ListBoxViewType.SelectedItem.Text
this.ListBoxViewType.SelectedItem.Value