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.QuerySt ring["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.Qu eryString["qty_" + strPartNo];
which attempts to implicitely cast it or:
int lngQty = Convert.ToInt32 (Request.QueryS tring["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*******@disc ussions.microso ft.com> wrote in message
news:B5******** *************** ***********@mic rosoft.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.QuerySt ring("pn")
lngQty = Request.QuerySt ring("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.QuerySt ring["pn"])
{
int lngQty = Request.QuerySt ring["qty_" + strPartNo];
Response.Write( strPartNo+Reque st.QueryString["pn"]+"<br>");
}