将参数从一个页面传递到另一个VB.net

时间:2017-07-19 13:49:03

标签: asp.net .net vb.net

我有两个页面,Act_Summary和Details。在“摘要”页面上,他们将单击一个链接,将其带到详细信息页面。我想要3个参数,UserName,StartDate和EndDate,只要他们点击链接就会传递到详细信息页面。但是每次我点击链接时都会给我这个错误:

  

对象引用未设置为对象的实例

这是我在摘要页面上的代码:

    Dim UserName As String = Encryption64.Decrypt(Request.QueryString("UserName"))
    Dim StartDate As String = Encryption64.Decrypt(Request.QueryString("SD"))
    Dim EndDate As String = Encryption64.Decrypt(Request.QueryString("ED"))

    Page.Title = "" & UserName & "'s Activity Summary"

    Dim SqlString As String = "Select Username, SD, ED"

    Dim MyDataTable As DataTable = OleFun.GetMyDataTableString(SqlString)

    WebDataGrid1.DataSource = MyDataTable
    WebDataGrid1.DataBind()

这是我在详细信息页面上的代码:

XMLELEMENT( Name "Telephone",
case
when not exists (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'phonebook' AND COLUMN_NAME = 'pv_an4') then ''
when exists (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'phonebook' AND COLUMN_NAME = 'pv_an4') then pv_an4
end ),

提前感谢您的回复。

1 个答案:

答案 0 :(得分:0)

哈哈哇,整个时间都是因为我有一个名为" user"在URL中,并将其解密为UserName ... Face Palm