Not knowing he error, it's a little hard to tell. Right off the bat though,
it could be because you can't just set a variable equal to the querystring.
When you reference Request.QueryString["qty_" + strPartNo], how will it know
what to do with the value. In VBScript, all the variables are of type
variant. This means they change their behavior depending upon their context.
In strongly typed languages, such as C#, you have to implicitely cast the
value. You can try to do it in two ways:
one way is:
int lngQty = (int)Request.QueryString["qty_" + strPartNo];
which attempts to implicitely cast it or:
int lngQty = Convert.ToInt32(Request.QueryString["qty_" +
strPartNo].ToString());
passes it through the convert function to change the string value into a
32-bit int.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"mahsa" <an*******@discussions.microsoft.com> wrote in message
news:B5**********************************@microsof t.com...
Hi have have some link like this
http://x.com/Shoppingcart.aspx?pn=ps...&action=update now I want to request the data
I use this code in asp
<%For Each strPartNo In Request.QueryString("pn")
lngQty = Request.QueryString("qty_" & strPartNo)
strPartNo = LCase(strPartNo)
Response.Write("strPartNo"& strPartNo& lngQty)
Next
%>
but in .Net when I try to use it it say it have error do you have any idea
foreach (string strPartNo in Request.QueryString["pn"])
{
int lngQty = Request.QueryString["qty_" + strPartNo];
Response.Write(strPartNo+Request.QueryString["pn"]+"<br>");
}