doramail05
asked on
Getting all querystrings
i try to get all querystring with
public NameValueCollection QueryString { get; }
but have error on 'NameValueCollection' in both,
NameValueCollection coll=Request.QueryString;
public NameValueCollection QueryString { get; }
but have error on 'NameValueCollection' in both,
NameValueCollection coll=Request.QueryString;
namespace BlankRoom
{
public NameValueCollection QueryString { get; }
public partial class blankajax : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int loop1, loop2;
// Load NameValueCollection object.
NameValueCollection coll=Request.QueryString;
// Get names of all keys into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Key: " + Server.HtmlEncode(arr1[loop1]) + "<br>");
String[] arr2 = coll.GetValues(arr1[loop1]);
for (loop2 = 0; loop2 < arr2.Length; loop2++)
{
Response.Write("Value " + loop2 + ": " + Server.HtmlEncode(arr2[loop2]) + "<br>");
}
}
}
ASKER
cannot, pointing to namevaluecollection in both
public NameValueCollection QueryString = new NameValueCollection();
public NameValueCollection QueryString = new NameValueCollection();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
public NameValueCollection QueryString = new NameValueCollection();
instead of
public NameValueCollection QueryString { get; }