Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.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,我试图弄清楚如何使用ASP.NET VB中的“Response.Redirect”从gridview中获取两列,如果可能的话,从同一页的下拉列表中获取两列,并将其发送到下一页的标签。这可能吗 另外,我有点难以理解上面写着“房间和名字”的地方。我在哪里找到这些的正确输入?谢谢你的帮助 更新: Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Ha

我试图弄清楚如何使用ASP.NET VB中的“Response.Redirect”从gridview中获取两列,如果可能的话,从同一页的下拉列表中获取两列,并将其发送到下一页的标签。这可能吗

另外,我有点难以理解上面写着“房间和名字”的地方。我在哪里找到这些的正确输入?谢谢你的帮助

更新:

    Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged

    Response.Redirect("RoundingEntry.aspx?Room=" & GridView1.SelectedRow.Cells(1).Text & "&Name=" & GridView1.SelectedRow.Cells(2).Text & "&Rounder=" & DDRounder.SelectedValue)

    End Sub
在我的下一页/接收页上,我有这个

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    If Me.Page.PreviousPage IsNot Nothing Then
        Dim rowIndex As Integer = Integer.Parse(Request.QueryString("RowIndex"))
        Dim GridView1 As GridView = DirectCast(Me.Page.PreviousPage.FindControl("GridView1"), GridView)
        Dim row As GridViewRow = GridView1.Rows(rowIndex)

        Dim room As String = Request.QueryString("Room")
        Dim name As String = Request.QueryString("Name")
        Dim Rounder As String = Request.QueryString("Rounder")
        lblRoom.Text = room
        lblPatientName.Text = name
        lblRounder.Text = Rounder

    End If
End Sub
lblRoom.Text的源代码

<asp:Label ID="lblRoom" runat="server" BackColor="White" Height="22px" 
     Width="100px" BorderColor="#CCCCCC" BorderStyle="Inset" BorderWidth="1pt" 
     style="text-align: center; background-color: #CCCCCC;"></asp:Label>

如果需要上一页控件中的值,可以使用
Server.Transfer(“page.aspx”)

如果您通过
querystring
,请使用
Request.querystring(“房间”)
&
Request.querystring(“名称”)

也来看看这个

您缺少此处的行索引

Response.Redirect("RoundingEntry.aspx?Room=" & GridView1.SelectedRow.Cells(2).Text & "&Name=" & GridView1.SelectedRow.Cells(3).Text "&RowIndex=?")
然后在下一页

Dim rowIndex As Integer = Integer.Parse(Request.QueryString("RowIndex"))
Dim room As String = Request.QueryString("Room")
Dim name As String = Request.QueryString("Name")
lblRoom.Text = room 
lblName.Text = name 

对不起,我想我没有投你的票。我正在尝试使用你在我的页面加载中给我的代码。然后如何为2个gridfields和一个ddl执行response.redirect部分?”lblRoom.Text=Request.QueryString(“房间”)lblName.Text=Request.QueryString(“名称”)lblRounder.Text=Request.QueryString(“Rounder”)(请参阅我上面更新的帖子)我在接收页面的Dim语句中有两个gridview字段和下拉列表,但在调用(lblRoom.Text=Room)时它显示“什么都没有”。你能粘贴你的url格式吗?应该看起来像
RoundingEntry.aspx?Room=roomname&Name=Name&Rounder=rounderval
这在调试中位于何处?感谢应该在url中,就像在浏览器的地址栏中一样。