Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.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 将控件强制转换到另一页_Asp.net_Vb.net - Fatal编程技术网

Asp.net 将控件强制转换到另一页

Asp.net 将控件强制转换到另一页,asp.net,vb.net,Asp.net,Vb.net,我什么都试过了,都没有用。我需要将值从用户选择的dropdownlist转换到另一页上的另一个dropdownlist。文本框中的数据是一系列数字 还有一种方法可以显示第二个下拉列表中的值以及其他值吗?例如,“我的下拉列表”的值为1-6,用户选择4,该值首先显示在第2页的下拉列表中,但其他值也会显示,以防他们想要更改其中的选择 If Not Page.PreviousPage Is Nothing Then Dim table As Control = PreviousPage.Contro

我什么都试过了,都没有用。我需要将值从用户选择的dropdownlist转换到另一页上的另一个dropdownlist。文本框中的数据是一系列数字

还有一种方法可以显示第二个下拉列表中的值以及其他值吗?例如,“我的下拉列表”的值为1-6,用户选择4,该值首先显示在第2页的下拉列表中,但其他值也会显示,以防他们想要更改其中的选择

If Not Page.PreviousPage Is Nothing Then
  Dim table As Control = PreviousPage.Controls(0).FindControl("table1")
  Dim ddl As DropDownList = CType(table.FindControl("ddlB_Codes"),c DropDownList)
If Not ddl Is Nothing Then
  ddl_OC.DataSource = ddl.SelectedValue.Substring(0, 6)
End If
End If
快速更新我终于通过一个会话完成了我的角色转换,只是现在我需要知道如何显示会话值和下拉框的其他附加值,以防用户想要更改某些内容?谢谢你的帮助

ddl_OC.DataSource = CType(Session.Item("valCodes"), String)
ddl_OC.DataBind()
ddl_SO.DataSource = CType(Session.Item("valAccts"), String)
ddl_SO.DataBind()

当第一个DropDownList发生更改时,使用event selectedvaluechanged为另一个DropDownList设置数据源。
不要忘了填充vin数据绑定函数用法。

您不想
cast
而是
将值从一个页面传递到另一个页面。我已经试过了,我一直在找一个空引用。。。这是我的密码。空引用位于下拉列表的dim ddl中。在我的sourcepage上,我有一个控件在这里