SelectPdf Free Html To Pdf Converter for .NET - Helper Page - View HTTP POST parameters - VB.NET / ASP.NET Sample

This page shows the HTTP POST variables sent to it.

Request method: GET

Sample code · VB.NET
Public Class view_http_post_data
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        ' Only ever fetched by the SelectPdf converter; flatten the screen-only
        ' sticky nav / scrollable rail so the PDF paginates cleanly. This class is
        ' at the ROOT namespace (no Namespace block), so the master type needs the
        ' Global. prefix — otherwise the VB root namespace (SelectPdf.Samples)
        ' makes "SelectPdf.Samples.…" resolve relative to itself and double-prefix.
        CType(Master, Global.SelectPdf.Samples.SelectPdf.Samples.Samples).FlattenForPdf = True
        LitText.Text = GetPostData()
    End Sub

    Private Function GetPostData() As String
        Dim output As New StringBuilder()
        output.Append("<br/>Request method: " + _
            Request.HttpMethod + "<br/>")

        ' Load POST form fields collection.
        Dim form As NameValueCollection = Request.Form

        ' Put the names of all keys into a string array.
        Dim keys As [String]() = form.AllKeys
        For i As Integer = 0 To keys.Length - 1
            output.Append("Name: " + keys(i) + "<br/>")

            ' Get all values under this key.
            Dim values As [String]() = form.GetValues(keys(i))
            For j As Integer = 0 To values.Length - 1
                output.Append("Value: " + values(j) + "<br/>")
            Next
            output.Append("<br/>")
        Next

        Return output.ToString()
    End Function

End Class