Deal with the query string (VB.net) : Query String « Request « ASP.Net






Deal with the query string (VB.net)

<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
    If Len(Request.QueryString("StoreID")) = 0 _
        or Len(Request.QueryString("ProductID")) = 0 Then
        lblMessage1.Text = "One or both of the fields " _
            & "StoreID or ProductID were not found in the " _
            & "QueryString collection!"
    Else
        lblMessage1.Text = "Store ID: " _
            & Request.QueryString("StoreID")
        lblMessage2.Text = "Product ID: " _
            & Request.QueryString("ProductID")
    End If
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>QueryString Sample Page</TITLE>
</HEAD>
<BODY >
<form runat="server">
<Font Face="Tahoma">
<asp:Label
    id="lblMessage1"
    runat="Server"
    Font-Bold="True"
/>
<BR><BR>
<asp:Label
    id="lblMessage2"
    runat="Server"
    Font-Bold="True"
/>
</Font>
</Form>
</BODY>
</HTML>

           
       








Related examples in the same category

1.Get query string from Request (C#)
2.Showing QueryString values via the QueryString Collection in ASP.NET
3.Send and get query string (C#)