早晨,
嗨,我陷入了如何从一个页面到另一个页面解析参数值的问题。
这是我已经完成的事情
在Functional.aspx.vb上,我将值从URL解析为Functional_Sub.aspx
For Each row As DataRow In dt.Rows
html.Append("<a href='Functional_Sub.aspx?flag=" + row(0) + "'>IKUTI</a>")
Next
我得到的是
URL中的'Functional_Sub.aspx?flag = FUNCP-000001'
在Functional_Sub.aspx.vb上,我尝试使用
Dim flag As String = Request.Params("flag")
Private Function GetData() As DataTable
Dim Connbackbone As String = ConfigurationManager.ConnectionStrings("BackboneConnectionString").ConnectionString
Using con As New SqlConnection(Connbackbone)
Using cmd As New SqlCommand("SELECT a.[IDFuncChild], b.[IDFuncParent], a.[nmSubKat] FROM [EL_MstFunctional_SubKat] a inner join [EL_MstFunctional_Kat] b on b.[IDFuncParent] = a.[IDFuncParent] where IDFuncParent = @IDFuncParent order by b.IDFuncParent, a.IDFuncChild")
cmd.Parameters.AddWithValue("@IDFuncParent", flag)
Using sda As New SqlDataAdapter()
cmd.Connection = con
sda.SelectCommand = cmd
Using dt As New DataTable()
sda.Fill(dt)
Return dt
End Using
End Using
End Using
End Using
End Function
但是我得到了这个结果
在这种情况下,请求不可用
请指导我。谢谢
答案 0 :(得分:0)
应该在页面生成之后。
A facade root has not been set.