I am trying to understand the GetValues for Form and QueryString in context.Request
I have a url like this, generated from an ajax handler on a multiple select html element
generic.ashx?tags=1&tags=2
in theory shouldnt this (submitted by post) set the string tags to 1, 2?
string[] tags = context.Request.Form.GetValues("tags");
I have tried using the get method as well, using querystring or just context request, nothing so far
string[] tags = context.Request.QueryString.GetValues("tags");
string[] tags = context.Request.GetValues("tags");
My bottom line is i want to build a sql where clause
int tagscount = tags.Count();
string sWhere ="";
if (tagscount != 0) {
sWhere ="Where (";
for (int i = 0; i < tagscount; i++)
{
sWhere += " tag_id ="+tags[i]+")";
if (i < tagscount -1){
sWhere += " OR ";
}
}
sWhere += ")";
}
but honestly i would just be thrilled at this point to show that my string is being populated
results = string.Format("{{ \"tags\": {0} }}",tags);
context.Response.Write(results);