Passing a parameter through server.execute?

后端 未结 4 842
南笙
南笙 2021-01-12 09:34

It is possible to pass a parameter through server.execute?

Fx. I have in my site.asp an IF-scenario where I need functions.asp?a=some

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 09:45

    In short: YES, you can use QueryString values in conjunction with Server.Execute within an ASP.NET page or application.

    You can pass dynamic variables in a QueryString argument assembled in the executing ASPX page (page1.aspx), as follows:

        Dim intExample1 As Int = 22
        Dim strExample2 As String = "hello world"
        Server.Execute("page2.aspx?number=" & intExample1 & "&string=" & Server.UrlEncode(strExample2))
    

    In this example, page2.aspx can then reference and use the following values:

        Request.QueryString("number")
        Request.QueryString("string")
    

提交回复
热议问题